TrackBar.Orientation Property

Definition

Gets or sets a value indicating the horizontal or vertical orientation of the track bar.

C#
public System.Windows.Forms.Orientation Orientation { get; set; }

Property Value

One of the Orientation values.

Exceptions

The assigned value is not one of the Orientation values.

Examples

The following example demonstrates how to set some of the TrackBar properties.

C#
trackBar2.Orientation = Orientation.Vertical;
trackBar3.Orientation = Orientation.Vertical;
trackBar1.Maximum = trackBar2.Maximum = trackBar3.Maximum = 255;
trackBar1.Width = 400;
trackBar2.Height = trackBar3.Height = trackBar1.Width;
trackBar1.LargeChange = trackBar2.LargeChange = trackBar3.LargeChange = 16;

Remarks

When the Orientation property is set to Orientation.Horizontal, the scroll box moves from left to right as the Value increases. When the Orientation property is set to Orientation.Vertical, the scroll box moves from bottom to top as the Value increases.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also