Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Using SplitContainer in MDI Form.
 

Using SplitContainer in MDI Form.

I am trying to split my main application into two separate panels using splitcontainer. I have gone through the forum responses earlier and havent found suitable answer to it.

The intent is to have left side with some options for user to click and then on right the workspace will opento work. The use also gets option to have multiple forms opened in the right panel. For this purpose i would like to use MDI interface.

One option is to have a docking framework(paid/freeware) and use it to implement the whole concept. The other was to have a tab control placed in the right panel and then adding forms at runtime in it, somehow didnt like that approch.

I tried using splitcontainer and adding form using the control.Add() function available and it gave me an exception and aborting the application without showing the form.

Having dropped the splitcontainer i switched to splitter and was able to achieve most of the work. However reading MSDN i read the following:
"Represents a splitter control that enables the user to resize docked controls. Splitter has been replaced by SplitContainer and is provided only for compatibility with previous versions"

So i am just wondering that support for the splitter class may end abruptly making my application incompatible with the new frameworks.

Can someone please tell other available options to implement such functionality. The reason i am interested in using splitcontainer is that i would like to make the left pane collapsable so that user gets maximum workspace if needed to work on the form.

Kavitesh Singh.
Kavitesh Singh  Friday, May 29, 2009 6:54 AM

Hi Kavitesh Singh,

"Represents a splitter control that enables the user to resize docked controls. Splitter has been replaced by SplitContainer and is provided only for compatibility with previous versions"

This sentence mean in order to run previous application which use Splitter, so in the current .NET CLR, the control is still contained along with SplitContainer. So what's the problem did you meet when using SplitContainer? How did you use it in your project? Did you receive any error message?

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Monday, June 01, 2009 6:22 AM
Trying to achieve this as stated above:

The intent is to have left side with some options for user to click and then on right the workspace will opento work. The use also gets option to have multiple forms opened in the right panel. For this purpose i would like to use MDI interface.

I realized i cannot use splitcontainer as it was a control class and could not be used on MDI main panel. So to divide the MDI screen in two parts i used a spiltter and then displayed the forms on right panel. The problem which i faced using splitter was to change the panel width at runtime. Using a split container i could easily change the parameters and expand either of the panes based on requirement as screen area.
However same could not be achieved using the splitter control. And also it looked pretty crude the way it display forms in the right panel.
Kavitesh Singh.
Kavitesh Singh  Tuesday, June 02, 2009 4:57 AM

Hi Kavitesh Singh,

You can follow the step to implement this.

1. Drag a Panel into the MDI form, set its Dock property to "Left".
2. Drag a Splitter to the MDI form, set its Dock property to "Left".
3. Drag a Panel into the rest space of the MDI form, set its Dock property to "Fill".
4. Set these two Panels' BorderStyle property to "Fixed3D" in order to recognize them.

Does this what you want?

Please feel free to tell me if I misunderstood something.

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Tuesday, June 02, 2009 8:06 AM
This is something i have already tried, It doesnt work for me.

I list down few of the problems observed:
1. If i put a panel as stated in Point 3 above, I dont see any child forms even if i set panel "Send it to back".
2. If you want to have a menu strip you will see lot of glitches. If i perform all 4 steps above and then try to add Menu strip.
3. Also if i fiddle with "Sent to back" panel in point 1, Menu gets hidden.

I am yet to try to move splitter based on my inputs. As stated, i wanted to hide/unhide form location based on the inout from user via button etc. If you check in Microsoft Outlook, you have a Folder list titled in Mail on the left side. Now if i click the << buttons on top i get extended viewing area for my mails.
I tried it in SDI and it worked fine using splitcontainer. However i wanted the main working area to be MDI. Thats where the problem is.

Kavitesh Singh.
Kavitesh Singh  Wednesday, June 03, 2009 6:53 AM

You can use google to search for other answers

Custom Search

More Threads

• Controls Location Changed
• making forms dynamic
• Where are the "Standard Menu Icons" located?
• Bug in components (VB)
• User Control / Inherited Control Question
• Make Form Designer Generate Code in .cpp instead of .h?
• Get BaseLine for InnerTextBox in a user control
• Form in Form
• winform +fillrectangle transparency +onpaint +invalidate
• CollectionEditor for Generic Objects doesn't show the type name correctly in Add Drop down.