Saturday, July 21, 2012 12:24 PM
my requirement is as follows. the form should be divided into two sections. the left side of the screens should contain heirarchical
tree. when the user clicks the node corresponding form should open on the write side (i tried using a spilt container but does'nt work).
only one form should be open at any time.Quick help appreciated.
Sunday, July 22, 2012 6:12 AMWe cannot help you if you don't describe how you attempted this. You mention a split container, but you don't detail how this control failed you, as others have successfully used it. So describe your form in more detail and also show any code connecting the pieces together.
Jose R. MCP
Monday, July 23, 2012 3:05 AM
I will explain with a button in panel1 spiltcontainer instead of heirarchical tree.
1)I first changed form1 properties to mdi parent = true in the property box.
2) i then dragged and dropped a spiltcontainer on to form one.
3)I created another form form2.
4) I added a button to spiltcontainer panel1
5)i added the following code to button.
Form2 frm = new Form2();
but i get error.
Tuesday, July 24, 2012 8:05 AMModerator
If a form is top-level, its parent is the desktop window. The form cannot be added to other controls. You have to set the TopLevel property to false.
Form2 frm = new Form2(); frm.TopLevel = false; this.splitContainer1.Panel2.Controls.Add(frm); frm.Show();
By the way, if you would like to put new form to Panel2, I think you don't have to set the form1's IsMdiParent property.
If there are any questions, please feel free to let me know.
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marked As Answer by Richards123 Tuesday, July 24, 2012 4:00 PM