Visual Basic Sample Programs: Horizontal & Vertical Scroll-bar Application System
Browse articles:
Auto Beauty Business Culture Dieting DIY Events Fashion Finance Food Freelancing Gardening Health Hobbies Home Internet Jobs Law Local Media Men's Health Mobile Nutrition Parenting Pets Pregnancy Products Psychology Real Estate Relationships Science Seniors Sports Technology Travel Wellness Women's Health
Browse companies:
Automotive Crafts, Hobbies & Gifts Department Stores Electronics & Wearables Fashion Food & Drink Health & Beauty Home & Garden Online Services & Software Sports & Outdoors Subscription Boxes Toys, Kids & Baby Travel & Events

Visual Basic Sample Programs: Horizontal & Vertical Scroll-bar Application System

A scroll bar is typically used to increase or decrease a value such as when we want to change the color setting of our computer’s monitor through the Control Panel’s Display object or to increase or decrease the volume of our computer’s digital audio speaker. The scroll bar acts as a sliding scale with a starting point and ending point, including the values in between.

Add another trick to your Visual Basic 6 toolbox by following simple Horizontal and Vertical scroll-bar application systems that demonstrate how a scroll bar works.

Horizontal Scroll Bar

Follow the given procedure below in designing and developing a simple horizontal scroll-bar application system.

Solution

  1. Select and click  the Visual Basic under  the Microsoft Visual Studio at the Start of the Taskbar and Programs submenu of the operating system.
  2. Start a new project and select the Standard EXE on the given displayed items, then click the Open command button.  Set the caption of the Form to Horizontal Scroll bar.
  3. Double-click the Horizontal Scroll bar and labels in the Toolbox to add them into the form.  Position them properly at the form.
  4. Set the Max property of HScroll to 100, its Value property to 50 and its LargeChange property to 10.
  5. Click the Font property of Label1 and set the Font Size property to 24 and its Autosize to True.
  6. Double-click the scroll bar to open the Code editor and add the following code:

Private Sub HScroll1_Change ( )

  Label1.Caption = Trim$ (Str$ (HScroll1.Value) )

End Sub

  1. Run the application system by selecting the Run menu at the menu bar and click the Start item (or click the Run icon at the tool bar).

Vertical Scroll Bar

Follow the given procedure below in designing and developing a simple vertical scroll-bar application system.

Solution:

  1. Select and click the Visual Basic under the Microsoft Visual   Studio at the Start of the Taskbar and Programs submenu of the operating system.
  2. Start a new project and select the Standard EXE on the given displayed items, then click the open command button.  Set the caption of the form to Vertical Scroll bar 1.
  3. double-click the Vertical Scroll bar and Labels in the Toolbox  to add them into the form.  Position them properly at the form.
  4. Set the Max property of Vscroll1 to 100, its Value property to 50 and its LargeChange property to 10.
  5. Click the Font property of Label1 and set the Font Size property to 24 and its Autosize to True.
  6. Double-click the scroll bar to open the Code editor and add the following code:

Private Sub VScroll1_Scroll ( )

   Label1.Caption = Trim$ (Str$ (VScroll1.Value) )

End Sub

Run the application system by selecting the Run menu at the menu bar and click the Start item (or click the Run icon at the toolbar).

Source:

   Introduction To Visual Basic 6 by Copernicus P. Pepito; Philippine Copyright 2005, National Book Store Reprint 2008

Need an answer?
Get insightful answers from community-recommended
experts
in Computer Programming & Languages on Knoji.
Would you recommend this author as an expert in Computer Programming & Languages?
You have 0 recommendations remaining to grant today.
Comments (4)

Well... I really enjoyed this litle bit of pogramming of VB. Used to be my one of my favourite programming languages in college days. :)

Nice share...very thought provoking and good educational piece, for sure.  Thanks for the information

Yes VB is indeed a very interesting subject to read. This brings back memories...

Learning Visual Basic programming software is somewhat complicated to learn at first. You really need to memorize all the programming codes that will work on visual basic, familiarize the visual interface of the software and possess an extensive logical skill. I like the concept of this article, thank you for sharing, keep it up! (LIKED and SHARED)

ARTICLE DETAILS
RELATED ARTICLES
RELATED CATEGORIES
ARTICLE KEYWORDS
RECENT SEARCHES ON KNOJI SHOPPING