Visual Basic ScrollBoxes Forms Controls
Visual Basic ScrollBoxes Forms Controls
Controls
1. Horizontal and Vertical Scroll Box in Visual Basic (15 Marks)
What is a Scroll Box?
In Visual Basic, a scroll box refers to the scroll bars (horizontal and vertical) that allow users
to view content that is too large to be displayed in a control or window. These are
commonly used with controls like TextBox, PictureBox, ListBox, etc.
Purpose of Forms:
- Create GUI (Graphical User Interface).
- Hold and manage controls.
- Handle user input and events.
Controls in Visual Basic:
Controls are interactive elements placed on forms to accept input, display output, and
interact with users.
Common VB Controls:
- Label: Displays static text
- TextBox: Takes input from the user
- Button: Performs an action on click
- CheckBox: Allows multiple selections
- RadioButton: Allows a single selection
- ListBox: Displays a list of items
- ComboBox: Drop-down list
- PictureBox: Displays images
- Timer: Performs actions at regular intervals
Code:
If TextBox1.Text = "admin" And TextBox2.Text = "1234" Then
MsgBox("Login Successful")
Else
MsgBox("Invalid Login")
End If
Conclusion:
In Visual Basic:
- Scroll boxes help users view content that doesn't fit in the visible area.
- Forms act as the user interface, and controls allow user interaction and input.
Both are essential for building user-friendly GUI applications.