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.A scroll bar control consists of a bar with arrows at each end. Visual basic provides two types of scroll bars-Horizontal scroll bar and vertical scroll bar.To  the right of client area is vertical scroll bar,which is a common component of windows that display text .If there is too much text to fit in the window at once,scroll bars enable the user to move around within the document to look at some subsection of the whole.At the bottom of the window is a horizontal scroll bar  that scrolls the text in the client area horizontally.To the right side of the horizontal scroll bar is the window’s sizing handle.

1. Start Visual Basic and pick “Standard Exe” from the list of new projects.

2. A form1 container is open.

3. Add Scrollbar  and TextBox1  tool from the toolbox.

 

 

 

 

 

 

 

 

 

4. Double click on scrollbar control.Code window is open. Write code here.

5. After you select Form1 object from object drop down list and select the procedure Load() from the procedure window .Write code here.

 

 

 

 

 

 

 

 

 

6.Press <f5> key to  run the program .

7. Scroll the scrollbox from scroll arrow.Its range isshown in textbox1.

Comments are closed.