Gets or sets a numeric value that represents the current position of the <span id="frameworks:scroll_box" class ="gp">scroll box</span> on the scroll bar control.
[Visual Basic] Public Property Value As Integer [C#] public int Value {get; set;} [C++] public: __property int get_Value(); public: __property void set_Value(int); [JScript] public function get Value() : int; public function set Value(int);
A numeric value that is within the Minimum and Maximum range.
The following example uses the derived class, VScrollBar and sets some of its common properties. This code assumes that a VScrollBar has been instantiated on a form.
[Visual Basic]
Private Sub MySub() ' Set the Minimum & Maximum properties. VScrollBar1.Minimum = 0 ' Set the maximum property equal to the height of the scroll bar. VScrollBar1.Maximum = VScrollBar1.Height ' Set the starting value (middle of the scroll bar). VScrollBar.Value = VScrollBar1.Maximum / 2 ' Set the SmallChange & LargeChange properties to a percentage of the Maximum property. VScrollBar1.SmallChange = VScrollBar1.Maximum / 25 VScrollBar1.LargeChange = VScrollBar1.Maximum / 10 End Sub
ScrollBar Class | ScrollBar Members | System.WinForms Namespace