, Form2 , , Form2, , . , , Program.cs:
MDIParent mdi = new MDIParent();
Form1 frm1 = new Form1();
frm1.MdiParent = mdi;
Form2 frm2 = new Form2();
frm2.MdiParent = mdi;
frm1.Show();
frm2.Show();
Application.Run(mdi);
, , Form2 . , !
, , 2, . , , , InitializeComponent. . , "Form3" :
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "Form3";
}
:
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.label1);
this.Name = "Form3";
this.Text = "Form3";
this.ResumeLayout(false);
this.PerformLayout();
}
, , . , , , , , .