Visual Basics::: Bhumika Shah.. Computer Engineering Department
Visual Basics::: Bhumika Shah.. Computer Engineering Department
Bhumika Shah..
Computer Engineering Department
Revising concepts…
Control
A control is a tool you use to create objects on a
Visual Basic form.
You select controls from the toolbox and use the
mouse to draw objects on a form.
You use most controls to create user interface
elements, such as command buttons, image
boxes, and list boxes…
Object
For example, this statement uses the Add Item method to put the
word Check in the List1 list box:
List1.AddItem "Check"
Variable
A variable or identifier is a special container
that holds data temporarily in a program.
Variables can store numbers, names, property
A label is a control you use to display text that a user can't edit
directly.
Label Events:
Click Event :: triggered when user clicks on a label.
DblClick Event :: triggered when user double-clicks on a label.
Creating Labels on a Form
set label properties ::
You can also set label properties with program code,
as shown in the following.
The program codes below, when command1 button
is clicked, will set the caption of label1 as “Welcome”
and label2 as “Please enter your name below:” ……
Private Sub Command1_Click ()
Label1.Caption = "Welcome"
Label2.Caption = "Please enter your name below:“
End Sub
Textbox
A Textbox is used to display information
entered at design time, by a user at run-time,
or assigned within code. The displayed text
may be edited.
This control performs two functions: