Download - Commonly used controls and their Properties
![Page 1: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/1.jpg)
Commonly Used Controls Computer II: Programming with Visual
Basic
![Page 2: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/2.jpg)
3rd Quarter Outline of Topics
Controls and their Codes Variables and Constants Operators and Functions Conditional Statements
› If-Then› If-Then-Else› Nested Ifs› Select Case
![Page 3: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/3.jpg)
Terms
Procedure – declarations that are performed when you do an action to an object
Design Time Run Time Events – Methods -
![Page 4: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/4.jpg)
Form Properties
Caption – sets the text on the title bar Back Color – background color Control Box
› True: Makes the Control Menu visible
› False: Hides the Control Menu
![Page 5: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/5.jpg)
Form Properties
BorderStyle › 0 – None: Can’t be resized, No Title Bar› 1- Fixed Single: Border can’t be resized at
runtime, Title Bar only has the close button, cannot be moved
› 2 – Sizable: Default Setting, Border can be resized and Title Bar has Minimize, Maximize and Close Buttons
![Page 6: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/6.jpg)
0-NONE 1-FIXED
SINGLE
2-SIZABLE
![Page 7: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/7.jpg)
Common Form Event
Load – performed as the form is being loaded › Can be accessed by double-clicking an
empty space on the form
Sample Code:Private Sub Form_Load
Form1.BackColor = vbBlueEnd Sub
![Page 8: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/8.jpg)
Design TimeRun Time
![Page 9: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/9.jpg)
Command Button Properties
Caption – sets the text on the button Default – determines which is the
default command button on the form› True: Button is activated when Enter is
pressed Cancel – indicates whether a button is
the cancel button in a form› True: Button is activated when ESC is
pressed
*Note: You can only have one Default and Cancel button on a Form
![Page 10: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/10.jpg)
Command Button Properties
Style – sets the appearance of a control› 0 – Standard : Text-Only› 1 – Graphical : Can contain a Picture or
Colored Background Enabled – sets whether a control can
interact with an event› Can be True or False
Visible – Hides or shows a button › Can be True or False
![Page 11: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/11.jpg)
Common Command Button Event
Click - performs an action when the control is clicked
Syntax:Private Sub Command1_Click ()
StatementsEnd Sub
![Page 12: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/12.jpg)
Label Properties
Alignment - Sets the alignment› 0-Left Justify: Align Left › 1-Right Justify: Align Right› 2-Center: Align Center
Auto Size – automatically resizes the label to fit the contents› Can be True or False
Back Style – indicates whether the background is transparent or opaque
![Page 13: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/13.jpg)
Text Box Properties
Text – displays text on the text box Max Length – limits the number of
characters to be entered by the user Password Char – Sets the character
that would mask the characters entered by the user
![Page 14: Commonly used controls and their Properties](https://reader036.vdocuments.us/reader036/viewer/2022062405/555eddaad8b42a772f8b52d9/html5/thumbnails/14.jpg)
Text Box Properties
Locked – sets whether the user can edit the text on a control› True: User can’t edit the text › False: User can edit the text
Tab Index – sets the order in which controls get the focus› Starts at zero