Which code segment should you use?

You use Microsoft .NET Framework 4 to create a Windows Forms client application. You write the following code segment. NotInheritable Class FormSettings Inherits ApplicationSettingsBase <UserScopedSetting> _ <DefaultSettingValue(“225, 200”)> _ Public Property FormSize() As Size Get Return DirectCast(Me(“FormSize”), Size) End Get Set Me(“FormSize”) = value End Set End Property End Class The application contains a form of type Form1 that contains a FormSettings object named frmSettings1. You need to maintain the user’s form size preference each time the user executes the application. Which code segment should you use?

You use Microsoft .NET Framework 4 to create a Windows Forms client application. You write the following code segment. NotInheritable Class FormSettings Inherits ApplicationSettingsBase <UserScopedSetting> _ <DefaultSettingValue(“225, 200”)> _ Public Property FormSize() As Size Get Return DirectCast(Me(“FormSize”), Size) End Get Set Me(“FormSize”) = value End Set End Property End Class The application contains a form of type Form1 that contains a FormSettings object named frmSettings1. You need to maintain the user’s form size preference each time the user executes the application. Which code segment should you use?

A.
Private Sub Form1_Load(sender As Object, e As EventArgs) frmSettings1.Reset() End Sub Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) frmSettings1.FormSize = Me.Size frmSettings1.Save() End Sub

B.
Private Sub Form1_Load(sender As Object, e As EventArgs) frmSettings1.Reset() End Sub Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) frmSettings1.FormSize = Me.Size frmSettings1.Upgrade() End Sub

C.
Private Sub Form1_Load(sender As Object, e As EventArgs) Me.Size = frmSettings1.FormSize End Sub Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) frmSettings1.FormSize = Me.Size frmSettings1.Upgrade() End Sub

D.
Private Sub Form1_Load(sender As Object, e As EventArgs) Me.Size = frmSettings1.FormSize End Sub Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) frmSettings1.FormSize = Me.Size frmSettings1.Save() End Sub



Leave a Reply 0

Your email address will not be published. Required fields are marked *