You are creating a multiple-document interface (MDI) application by using the .NET
Framework 3.5.You configure the frmParent form to be an MDI parent.You write the
following code segment. (Line numbers are included for reference only.)
01 Form frmChild = new Form();
02 Form frmParent = this;
03
You need to associate and display the frmChild form and the frmParent form. Which code
segment should you add at line 03?
A.
frmChild.MdiParent = frmParent;
frmChild.ShowDialog();
B.
frmChild.MdiParent = frmParent;
frmChild.Show();
C.
frmChild.IsMdiContainer = true;
frmChild.ShowDialog();
D.
frmChild.IsMdiContainer = true;
frmChild.Show();
Explanation:
//This example takes place in a method in the parent form, and assumes a Forms called ChildForm
ChildForm aChildForm = new ChildForm();
//Sets the MdiParent property to the parent form
aChildForm.MdiParent = this;
aChildForm.Show();
MCTS Self-Paced Training Kit (Exam 70-505): Microsoft.Net Framework 3.5-Windows Forms Application Development (pg. 554)