I am bulding a Windows Form Application in Visual Studio using C#.
In my application the main form (form1) has a usercontrol with a button. When the user clicks the button I would like a MdiChild form (of form1) to appear.
Normally when opening a MdiChild from a button on a parent form or another child form I use:
However, this does not work with the Usercontrol button due to an error that states the Usercontrol does not contain a definition for MdiParent.
I am still new to programming but any help would be greatly appreciated.
In my application the main form (form1) has a usercontrol with a button. When the user clicks the button I would like a MdiChild form (of form1) to appear.
Normally when opening a MdiChild from a button on a parent form or another child form I use:
Code:
private void Button1_Click(object sender, EventArgs e) { Form2 newMdiChild = new Form2(); newMdiChild.Mdiparent = this.Mdiparent; newMdiChild.Show();
I am still new to programming but any help would be greatly appreciated.
Comment