Upload
ephraimq
View
219
Download
0
Embed Size (px)
Citation preview
8/14/2019 3Q Commonly Used Controls
1/14
8/14/2019 3Q Commonly Used Controls
2/14
Controls and their CodesVariables and Constants
Operators and FunctionsConditional Statements
If-Then
If-Then-Else Nested Ifs
Select Case
8/14/2019 3Q Commonly Used Controls
3/14
Procedure declarations that areperformed when you do an action to an
objectDesign Time
Run Time
Events Methods -
8/14/2019 3Q Commonly Used Controls
4/14
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
8/14/2019 3Q Commonly Used Controls
5/14
BorderStyle
0 None: Cant be resized, No Title Bar
1- Fixed Single: Border cant be resized atruntime, Title Bar only has the closebutton, cannot be moved
2 Sizable: Default Setting, Border can be
resized and Title Bar has Minimize,Maximize and Close Buttons
8/14/2019 3Q Commonly Used Controls
6/14
8/14/2019 3Q Commonly Used Controls
7/14
Load performed as the form is beingloaded
Can be accessed by double-clicking anempty space on the form
Sample Code:
Private Sub Form_Load
Form1.BackColor = vbBlue
End Sub
8/14/2019 3Q Commonly Used Controls
8/14
8/14/2019 3Q Commonly Used Controls
9/14
Caption sets the text on the buttonDefault determines which is the default
command button on the form
True: Button is activated when Enter is pressed
Cancel indicates whether a button is thecancel button in a form
True: Button is activated when ESC is pressed
*Note: You can only have one Default andCancel button on a Form
8/14/2019 3Q Commonly Used Controls
10/14
Style sets the appearance of a control
0 Standard : Text-Only
1 Graphical : Can contain a Picture orColored Background
Enabled sets whether a control caninteract with an event
Can be True or False
Visible Hides or shows a button
Can be True or False
8/14/2019 3Q Commonly Used Controls
11/14
Click - performs an action when thecontrol is clicked
Syntax:
Private Sub Command1_Click ()
StatementsEnd Sub
8/14/2019 3Q Commonly Used Controls
12/14
Alignment - Sets the alignment 0-Left Justify: Align Left
1-Right Justify: Align Right
2-Center: Align Center
Auto Size automatically resizes the labelto fit the contents
Can be True or FalseBack Style indicates whether the
background is transparent or opaque
8/14/2019 3Q Commonly Used Controls
13/14
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 charactersentered by the user
8/14/2019 3Q Commonly Used Controls
14/14
Locked sets whether the user canedit the text on a control
True: User cant edit the text False: User can edit the text
Tab Index sets the order in whichcontrols get the focus
Starts at zero