How to Use Scrollbar Control in Visual Basic 6.0

Written by warren rachele
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Use Scrollbar Control in Visual Basic 6.0
(Comstock Images/Comstock/Getty Images)

Visual Basic 6 supports two scroll bar controls with similar functionality, the HScrollBar and VScrollBar. The HScrollBar is a horizontal control and the other vertical. Both controls perform the same function in enabling the user to set a numeric value by moving the scroll box along the bar. You can retrieve this value and use it to affect other controls or to modify settings within your application. A good example to visualise the use of this control is a sliding volume control on a media player application.

Skill level:

Other People Are Reading


  1. 1

    Select the "HScrollBar" or "VScrollBar" control from the toolbox. Both are located in the Common Controls section. If the Visual Basic IDE is not displaying the toolbox, click “View” and ”Toolbox” or press “Ctrl-Alt-X” to display the panel.

  2. 2

    Click on the form to which you want to add the scroll bar. The horizontal or vertical bar is added to the form in its default state and size. If your design calls for a different size or shape, drag out the target shape when you place the control. These new dimensions are set in the control’s properties.

  3. 3

    Set the properties for the scroll bar control in the Properties panel. If this panel is not visible, press “Alt-Enter” or click “View” and ”Properties.” The scroll bars have few properties; those most often used are:

    Minimum – the value for the left or bottommost scroll bar position Maximum – the value for the right or topmost scroll bar position LargeChange – amount the Value property changes when the user clicks to the side of the scroll box SmallChange – amount the Value property changes when the user clicks on the scroll bar arrows Dock – anchors the scroll bar to one of the sides of the application form

  4. 4

    Compile your program to confirm that the control’s behaviour is as expected.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.