Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

TrackBar.Value Property

Gets or sets a numeric value that represents the current position of the scroll box on the track bar.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[<BindableAttribute(true)>]
member Value : int with get, set

Property Value

Type: System.Int32
A numeric value that is within the Minimum and Maximum range. The default value is 0.

ExceptionCondition
ArgumentException

The assigned value is less than the value of Minimum.

-or-

The assigned value is greater than the value of Maximum.

The Value property contains the number that represents the current position of the scroll box on the track bar.

The following code example displays a form that contains a TrackBar control and a TextBox control. The example demonstrates setting the Maximum, TickFrequency, LargeChange, and SmallChange properties and handling the Scroll event. The TextBox contents are updated to the Value property value when the Scroll event occurs.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft