Freetutes.com - Free Visual basic Tutorial website on the web

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > VB6 (Beginners Tutorial)

Previous Page | Table of Contents | Next Page

Sponsored Links

Using ScrollBar Control In Visual Basic

 
The ScrollBar is a commonly used control, which enables the user to select a value by positioning it at the desired location. It represents a set of values. The Min and Max property represents the minimum and maximum value. The value property of the ScrollBar represents its current value, that may be any integer between minimum and maximum values assigned.

Following example illustrates the ScrollBar control

* Open a new Standard EXE project and name the form as ScrollBar.frm and name the project as ScrollBar.vbp

* When the thumb's position of the ScrollBar is changed the value has to displayed in the TextBox.

* Design the application as shown below.

Object
Property
Setting
Form

Caption

Name

Scroll Bar

frmScrollbar

CommandButton

Caption

Name

Exit

cmdExit

VScrollBar

Max

Min

Name

Value

100

0

vsb1

50

TextBox

Name

Text

txtPercentage

%

The following codes are entered in the vsb1_Change( ) and cmdExit_Click( ) procedures.

Save the project and run the application by pressing F5 or clicking the Run icon in the ToolBar. We can see the value changes as soon as you move the thumb's position of the vertical scroll bar.

( Download the source code)

Previous Page | Table of Contents | Next Page

 

 

 

   
Home | Link to Us | Partner Links | About Us | Contact Us
Copyright © 2007-2008 Freetutes.com | All Rights Reserved