Click here to Skip to main content
15,903,730 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I have the Three winform say Form1,Form2,Form3.In that (Form1)one is mdiparent form and contain menu etc. Other than mdiparent form ,I have one button in Form2 from and when i click on that button ill be opening Form3 form. I have write the code like this

C#
private void xbtnNew_Click(object sender, EventArgs e)
{
Form3 objForm=new Form3();
obForm.ShowDialog();
}


Now i want set the mdiparent to form3. when i write like
objForm.Mdiparent =Form1; ill getting error.


How can i set the mdiparent to form3 ?

Please help urgent

Thanks
Posted
Updated 6-Mar-12 21:44pm
v2

1 solution

Set it to the same parent as the current form:
C#
objForms.MdiParent = MdiParent;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900