Description
The Vertical
property of the SplitContainer
class determines the layout orientation of the split container. When set to true
, the container is laid out vertically, meaning the panels are stacked one on top of the other. In this configuration, the Left
panel is considered the top panel, and the Right
panel is considered the bottom panel. Conversely, when set to false
, the panels are arranged horizontally, with the Left
panel on the left and the Right
panel on the right.
Usage
To use the Vertical
property, simply set it to true
or false
depending on the desired layout orientation. For example, if you want the panels to be stacked vertically, set Vertical
to true
. If you prefer a horizontal layout, set it to false
.
Example
// Create a new SplitContainer
var splitContainer = new SplitContainer();
// Set the SplitContainer to be vertical
splitContainer.Vertical = true;
// Access the top panel (formerly known as Left)
var topPanel = splitContainer.Left;
// Access the bottom panel (formerly known as Right)
var bottomPanel = splitContainer.Right;
// Set the SplitContainer to be horizontal
splitContainer.Vertical = false;
// Access the left panel
var leftPanel = splitContainer.Left;
// Access the right panel
var rightPanel = splitContainer.Right;