Hi, everybody.
I have some problems during MDI application development using Windows Forms.
Imagine small test application with 3 forms: Form1, Form2 and Form3. Form1 is an MdiContainer (with attached menuStrip element with single botton - for test purposes). Form2 contains only single button. Form2 openes by the click on Form1 menuStrip button. Form3 should open by Form2 button click.
I've already used google for this trouble, but nothing helpful.
My code is below:
Form1
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void menu2ToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 chWin = new Form2();
chWin.MdiParent = this;
chWin.Show();
}
}
Form2
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form3 form3 = new Form3();
form3.Show();
}
}
Form3 actually has no code at all.
It is quite obvious that I have somehow declare that Form3 should be Form1 child but how? :)
Thanks in advance!