How to: Create a Multipane User Interface with Windows Forms Using the Designer
In the following procedure, you will create a multipane user interface that is similar to the one used in Microsoft Outlook, with a Folder list, a Messages pane, and a Preview pane. This arrangement is achieved chiefly through docking controls with the form.
When you dock a control, you determine which edge of the parent container a control is fastened to. Thus, if you set the Dock property to Right, the right edge of the control will be docked to the right edge of its parent control. Additionally, the docked edge of the control is resized to match that of its container control. For more information about how the Dock property works, see How to: Dock Controls on Windows Forms.
This procedure focuses on arranging the SplitContainer and the other controls on the form, not on adding functionality to make the application mimic Microsoft Outlook.
To create this user interface, you place all the controls within a SplitContainer control, which contains a TreeView control in the left-hand panel. The right-hand panel of the SplitContainer control contains a second SplitContainer control with a ListView control above a RichTextBox control. These SplitContainer controls enable independent resizing of the other controls on the form. You can adapt the techniques in this procedure to craft custom user interfaces of your own.
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Working with Settings.
To create an Outlook-style user interface at design time
Create a new Windows Application project. For details, see How to: Create a New Windows Forms Application Project.
Drag a TreeView control from the Toolbox to the left-hand panel of the SplitContainer control. In the Properties window, set the Dock property to Left by clicking the left hand panel in the value editor shown when the down arrow is clicked.
Drag another SplitContainer control from the Toolbox; place it in the right-hand panel of the SplitContainer control you added to your form. In the Properties window, set the Dock property to Fill and the Orientation property to Horizontal.
At this point, if you press F5 to run the application, the form displays a three-part user interface, similar to that of Microsoft Outlook.
When you put the mouse pointer over either of the splitters within the SplitContainer controls, you can resize the internal dimensions.
At this point in application development, you have crafted a sophisticated user interface. The next step is proceeding with the programming of the application itself, perhaps by connecting the TreeView control and ListView controls to some kind of data source. For more information about connecting controls to data, see Data Binding and Windows Forms.