Export (0) Print
Expand All

VScrollBar Class

Represents a standard Windows vertical scroll bar.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

[ComVisibleAttribute(true)] 
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
public class VScrollBar : ScrollBar
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
public class VScrollBar extends ScrollBar
ComVisibleAttribute(true) 
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
public class VScrollBar extends ScrollBar
Not applicable.

Most controls that need scroll bars already provide them and do not require this control. This is true of a multiline TextBox control, a ListBox, and a ComboBox, for example.

You can use this control to implement scrolling in containers that do not provide their own scroll bars such as a PictureBox or for user input of numeric data. The numeric data can be displayed in a control or used in code. The Minimum and Maximum properties determine the range of values the user can select. The LargeChange property determines the effect of clicking within the scroll bar but outside the scroll box. The SmallChange property determines the effect of clicking the scroll arrows at each end of the control.

The following example creates and initializes a VScrollBar and adds it to a Form.

private void InitializeMyScrollBar()
 {
    // Create and initialize a VScrollBar.
    VScrollBar vScrollBar1 = new VScrollBar();
    
    // Dock the scroll bar to the right side of the form.
    vScrollBar1.Dock = DockStyle.Right;
    
    // Add the scroll bar to the form.
    Controls.Add(vScrollBar1);
 }
 

private void InitializeMyScrollBar()
{
    // Create and initialize a VScrollBar.
    VScrollBar vScrollBar1 = new VScrollBar();

    // Dock the scroll bar to the right side of the form.
    vScrollBar1.set_Dock(DockStyle.Right);

    // Add the scroll bar to the form.
    get_Controls().Add(vScrollBar1);
} //InitializeMyScrollBar

System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Windows.Forms.Control
         System.Windows.Forms.ScrollBar
          System.Windows.Forms.VScrollBar

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft