Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am facing an issue when trying with MDI Container. I have made my home page form-Home as IsMDIContainer = true in properties. When I click a button on the home page form I should open another form. Following is the code snippet I've used is this correct what change I need to do. but the form didnt show


C#
Test objTest = new Test();
        objTest.MdiParent = this;
        objTest.Show();


I've used split panel in home page, the size of the page I'm calling is the panel2 size of split panel

Thanks in advance
Posted
Updated 11-Aug-11 20:41pm
v2
Comments
Suresh Suthar 12-Aug-11 2:42am    
Code seems correct. What error you are getting?
CyborgForever 12-Aug-11 2:47am    
I 've already told in my question the form does'nt show at all. But if I remove objTest.MdiParent = this; it work good ie shows the form , but I want it within the Home MDI

1 solution

Ok, I got it. You have added SplitContainer that is hiding your Child Form.
Add child form to SplitContainer's panel
splitContainer1.Panel2.Controls.Add(objForm);
 
Share this answer
 
Comments
CyborgForever 12-Aug-11 3:27am    
Thank u so much, I'm new to windows environment so thats y my questions are basic, CP is very useful

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