1.
Visual Basic Basics & Properties
Modes of Changing Properties: Properties can be modified during Design Time (via the
Properties Window/F4) or Run Time (via coding)1.
Common Control Properties:
o Name: Identifies the control in code2.
o BackColor: Sets background color3.
o Font: Sets style, size, and font4.
o ForeColor: Sets text color5.
o Text: Sets the text displayed on the control6.
Run-Time Syntax: The format for changing a property via code is:
o Example: [Link] = 1008.
2. Key Controls & Their High-Yield Properties
TextBox Control
Used for inputting or displaying text/numeric data (cannot handle images)9.
MaxLength: Defines character limit10.
MultiLine: Set to True to allow more than one line of text11111111.
+1
PasswordChar: Use a character (like *) to hide sensitive input12.
ReadOnly: Set to True to prevent the user from editing the text13131313.
+1
Button Control
Used to execute commands (e.g., Save, Open)14.
The primary event for a Button is the Click event15.
ListBox & CheckedListBox
Items property: Used to add choices during design time16.
.[Link] method: Used to add items during run time17.
CheckedListBox: Similar to ListBox but adds a checkbox next to each item18.
RadioButton vs. CheckBox
Control Function Usage
Choose only one option from
RadioButton Used for mutually exclusive choices20.
a set19.
Used for selecting several preferences
CheckBox Choose multiple options21.
at once22.
3. Container & Media Controls
GroupBox: A container used to organize and group other controls23. If you move or hide the
GroupBox, all controls inside it move or hide as well24.
+1
PictureBox: Used to display images (BMP, GIF, JPEG)25.
o SizeMode: Adjusts how the image fits (e.g., AutoSize matches control size to picture size)26.
o Run-Time Image Syntax:
27
[Link] = [Link]("filename")
4. Built-in Functions
MsgBox() Function
Displays a dialog box with a message and buttons; returns which button was clicked28.
Syntax: MsgBox("Text", button, "Title")29.
o Text: The message30.
o button: Numeric value (e.g., 0 for OK, 1 for Cancel)31.
o Title: Text in the dialog title bar32.