Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My application has 3 forms(form1,form2,form3). Form1 is parent container of form2 and when form2 calls form3 appears out side the form1. And my question how can i make form3 appear within form1??

CodeSnippet:
C#
//FORM1 code
FORM2 f2=new FORM2();
f2.Mdiparent=this;               ///Call a instance of Form2
f2.Show();

//FORM2 code
FORM3 f3=new FORM3();                 ///Call a instance of Form3
if(f3.Showdialog()==Dialogresult.OK)
{
}      
Posted
Updated 3-Sep-13 22:09pm
v2

The best way is to have form2 ask form1 to do it - that way it doesn't need to know any more about it. See here: Transferring information between two forms, Part 3: Child to Child[^] - it's not directly relevant, since it assumes that the form2 and form3 exist already, but it shows the general principle.
 
Share this answer
 
 
Share this answer
 
Comments
Sharath2790 4-Sep-13 4:13am    
but unable use showdialog();

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