Export (0) Print
Expand All

How to: Split a Window Horizontally

The following code example makes the splitter that divides the SplitContainer control horizontal.

Note Note

The Orientation property of the SplitContainer control determines the direction of the splitter, not of the control itself.

To split a window horizontally

  • Within a procedure, set the Orientation property of the SplitContainer control to Horizontal.

    public void showSplitContainer()
    {
        SplitContainer splitContainer1 = new SplitContainer ();
        splitContainer1.BorderStyle = BorderStyle.Fixed3D;
        splitContainer1.Location = new System.Drawing.Point (74, 20);
        splitContainer1.Name = "DemoSplitContainer";
        splitContainer1.Size = new System.Drawing.Size (212, 435);
        splitContainer1.TabIndex = 0;
        splitContainer1.Orientation = Orientation.Horizontal;
        this.Controls.Add (splitContainer1);
    
    }
    
Show:
© 2014 Microsoft