Click here to Skip to main content
16,016,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good day! I'm just wondering if is it possible to open a new form inside a panel on a SplitContainer? For example, I have a main form with splitcontainer component. The 1st Panel on the container contains a TreeView and the 2nd panel is a work area. The idea is this, when I click a node on the TreeView, a form will appear on the 2nd panel. The idea here looks like in Visual Studio 2010, when you click a form from the Solution Explorer, the form will pop-up on the work area of the application. Any comment or suggestion is a big help. By the way, I am using Visual Basic 2010.
Posted

to open new form on panel use this code

VB
dim frm as new form
frm.show()
Mypanel.controls.add(frm)


Happy Coding!
:)
 
Share this answer
 
Solution 2

The above Solution Leeds Me the correct answer and I approve it


Form1 frm =new Form1();
frm.MdiParent=this;
frm.Show();
splitContainer1.Panel1.Controls.Add(frm);
 
Share this answer
 
Comments
Member 11802277 29-Jan-16 11:09am    
i have tried this but location of controls in form has been changed what should i do?
Member 13364751 13-Dec-17 6:09am    
the form2 button in form3 open splitcontainer panel2 but not layout set

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