Unit I-VB
Unit I-VB
Use sizing
handles to
resize object
Click here to
move object
Sample Application 1 – Design Mode
Figure 3.3
• Usage of Variables
• Copy and store values entered by the user
• Perform arithmetic manipulation on values
• Temporarily hold and manipulate the value
• Hold data/information so that it can be recalled for use at a later point in the code
Unit I – Data type
Data type - Specifies type of data that a variable can store
• Integer variables: Long, Integer, Short, Byte
• Floating-point variables: Single, Double
• Boolean variables: True, False
• Character variable: Char
• Text variable: String
• Object variable
• Default data type assigned by Visual Basic
• Can store many different types of data
• Less efficient than other data types
Visual Basic Data Types
Example
• txtExample.SetFocus ' moves cursor to box named txtExample
Label Properties:
Name Displays the name of the label button
Alignment Aligns caption within border.
Appearance Selects 3-D or flat appearance.
AutoSize If True, the label is resized to fit the text specified by
the caption property. If False, the label will remain the
size defined at design time and the text may be clipped.
BorderStyle Determines type of border.
Caption String to be displayed in box.
Font Sets font type, style, size.
Tool Box Control- Label Box
Label Events:
• Click Event triggered when user clicks on a label.
• DblClick Event triggered when user double-clicks on a label.
•The ampersand precedes a button's access key. That is, in addition to clicking on a
button to invoke its event, we can also press its access key (no need for a mouse).
•The access key is pressed in conjunction with the Alt key. Hence, to invoke Start
Timing', we can either click the button or press Alt+S.
•Note in the button captions on the form, the access keys appear with an
underscore (_).
THE TOOLBAR CONTROLS
•The Toolbox contains a set of controls which are used to customize forms.
•Using these controls, an interface between use and the application can be
created.
CONTROL DESCRIPTION
Pointer Used to interact with the controls on the form
Picture Box Used to display images
Textbox Used to accept user input which can display only editable text
Frame Used to group other controls
Command Button Used to initiate an action by pressing on the button
Check box Used to do a choice for user
Option Button Used in groups where one at a time can be true
List Box Used to provide a list of items
THE TOOLBAR CONTROLS
Control Description
Combo Box Used to provide a short list of items
Hscroll Bar A horizontal scrollbar
Vscroll Bar A vertical scrollbar
Timer Used to perform tasks in specified intervals.
DriveList Box Used to access the system drives
DirList Box Used to access the directories on the system
FileList Box Used to access the file in the directory
Shape Used to draw circles , rectangles , squares, ellipses
Line Used to draw lines
Image Used to display images
Data Used to connect a database
OLE Used to interact with other windows applications
Label Used to display texts which cannot be edited