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
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.
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.
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
Compile your program to confirm that the control’s behaviour is as expected.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for