System.Windows.Forms.SplitContainer Class

Represents a control consisting of a movable bar that divides a container's display area into two resizable panels.

See Also: SplitContainer Members


[System.ComponentModel.Designer("System.Windows.Forms.Design.SplitContainerDesigner, System.Design, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public class SplitContainer : ContainerControl


You can add controls to the two resizable panels, and you can add other System.Windows.Forms.SplitContainer controls to existing System.Windows.Forms.SplitContainer panels to create many resizable display areas.

Use the System.Windows.Forms.SplitContainer control to divide the display area of a container (such as a System.Windows.Forms.Form) and allow the user to resize controls that are added to the System.Windows.Forms.SplitContainer panels. When the user passes the mouse pointer over the splitter, the cursor changes to indicate that the controls inside the System.Windows.Forms.SplitContainer control can be resized.


Previous versions of the dnprdnshort only support the System.Windows.Forms.Splitter control.

System.Windows.Forms.SplitContainer also eases control placement at design time. For example, to create a window similar to Windows Explorer, add a System.Windows.Forms.SplitContainer control to a System.Windows.Forms.Form and set its Control.Dock property to DockStyle.Fill. Add a System.Windows.Forms.TreeView control to the System.Windows.Forms.Form and set its Control.Dock property to DockStyle.Fill. To complete the layout, add a System.Windows.Forms.ListView control and set its Control.Dock property to DockStyle.Fill to have the System.Windows.Forms.ListView occupy the remaining space on the System.Windows.Forms.Form. At run time, the user can then resize the width of both controls using the splitter. Use the SplitContainer.FixedPanel property to specify that a control should not be resized along with the System.Windows.Forms.Form or other container.

Use SplitContainer.SplitterDistance to specify where the splitter starts on your form. Use SplitContainer.SplitterIncrement to specify how many pixels the splitter moves at a time. The default for SplitContainer.SplitterIncrement is one pixel.

Use SplitContainer.Panel1MinSize and SplitContainer.Panel2MinSize to specify how close the splitter bar can be moved to the outside edge of a System.Windows.Forms.SplitContainer panel. The default minimum size of a panel is 25 pixels.

Use the SplitContainer.Orientation property to specify horizontal orientation. The default orientation of the System.Windows.Forms.SplitContainer is vertical.

Use the SplitContainer.BorderStyle property to specify the border style of the System.Windows.Forms.SplitContainer and coordinate its border style with the border style of controls that you add to the System.Windows.Forms.SplitContainer.


Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions:
Since: .NET 2.0