You are employed as an application developer at ABC.com. You make use of Microsoft .NET
Framework 4 to develop Windows Forms applications.
After creating a new client application, you configure a default form size in the UserScopedSetting
of the the ApplicationSettingsBase class.
Then application makes use of the Form1 type form, which includes a FormSettings object named
frmSettings1.
You have been instructed to write code that allows for the user’s preferred form size to be used
whenever the user opens the application.
Which of the following options should you write?
A.
public void Form2_Load(object sender, EventArgs e) { frmSettings2.start();
} public void Form2_FormClosing(object sender, FormClosingEventArgs e) {
frmSettings2.FormSize = this.Size;
frmSettings2.Save(); }
B.
private void Form1_Load(object sender, EventArgs e) { frmSettings1.UABCrade();
} private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{ Form1.FormSize = this.Size;
Form1.Delete(); }
C.
private normal Form1_Load(object sender, EventArgs e) { this.Size = frmSettings2.FormSize;
} public void Form2_FormClosing(object sender, FormClosingEventArgs e)
{ Form2.FormSize = this.Size;
Form2.UABCrade(); }
D.
private void Form1_Load(object sender, EventArgs e) { this.Size = frmSettings1.FormSize;
} private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{ frmSettings1.FormSize = this.Size;
frmSettings1.Save(); }
Explanation: