Professional Documents
Culture Documents
Visual Basic
Lección 03
String Concatenation
Assume the user has entered their name into the
TextBox txtName
You can allow the user to activate the button using Alt-S
instead of a mouse click
Be careful not to use the same access key for two
different buttons
‘&’ Has Special Meaning
in a Button
Note that the ‘&’ in “&Save” does
not display in the button control
on the form
It simply establishes the Alt Key
access
In order to actually display an ‘&’
on a button, it must be entered as
“&&”
Button text Save & Exit is entered
as Save && Exit
Declaring Variables
A variable declaration is a statement that creates a variable in
memory
This syntax is
Dim VariableName As DataType
Dim (short for Dimension) is a keyword
VariableName is the programmer designeted name
As is a keyword
DataType is one of many possible keywords for the type of
value the variable will contain
Example: Dim Length as Integer
Declaring Multiple Variables
Several variables maybe declared in one statement
if they all hold the same type of value
Dim Length, Width, Height as Integer