Windows Develop Bookmark and Share   
 index > Windows Forms General > mdi container with navigator & screens
 

mdi container with navigator & screens

hi,

Iam a newbie to c#.net

i have created a mdi parent which contains a navigator form on the left side of mdi container where the screen ids are displayed in treeview

when i click the treeview node the screen will be opened, but when i maximize the screen its hiding the navigator form also

i dont want this to happen, it should take the remaining space of navigator in the container

how to do this plz help me.
g.ram84  Thursday, September 17, 2009 6:08 AM
You can add a split container to your mdi parent. Cut and place your navigator into one panel and open your form in the other panel.
To add your form into the other panel do something along these lines:

MyForm frm = new MyForm();
frm.MdiParent = this;
this.splitContainer1.Panel2.Controls.Add(frm);
frm.Show();

Remember howeverto also remove the form from the panel before closing it.
Wole Ogunremi  Thursday, September 17, 2009 6:48 AM

this is working but when i maximize the form, the form header doesn't merge with the menu strip and it looks ugly.

is there any way to do this.


thanks for the reply.


g.ram84  Thursday, September 17, 2009 7:08 AM
In that case just get rid of the split container, instead add a panel to your mdi form, dock it to the side where you want it and put your navigator in the panel. It's probably a simpler approach than the split container.


Wole Ogunremi  Thursday, September 17, 2009 7:20 AM
thanks for ur immediate reply.


this is also working but the panel is not movable.

i want this to be movable.
g.ram84  Thursday, September 17, 2009 7:30 AM
Funny enough I was gonna edit my post to include how to do that!
Just add a Splitter control to your mdi form. It will automatically attach itself to the panel. The Splitter control is grouped in the All Windows Forms control group in your toolbox.

Good luck!

EDIT: I interpreted "movable" to mean ability resize the docked panel.
Wole Ogunremi  Thursday, September 17, 2009 7:33 AM
thanks for ur reply

i tried using a splitter but the splitter is also not resizable

how to do this.
g.ram84  Thursday, September 17, 2009 8:18 AM

You can use google to search for other answers

Custom Search

More Threads

• reading rss feed
• Any one pls Help - .Net Smart client application
• Dragging a window over a picture leaves huge trail
• Selective Fonts for different structure members!
• <Shift>Mouseclick not returning selectedItems
• Mouse pointer disappears behind form
• generic control that can handle all paper documents
• Who do I report a Bug in Windows Form to?
• disabled text color
• Custom control in a datagridview