Lec 2
Lec 2
handling.
Most of a GUI application’s functionality executes
based on events.
Event handling methods are called automatically.
When this event is raised (that is, the event occurs), method
ASimple-Program_Load executes to perform its task
—changing the text in the Label.
When you add a Label to a Form, the IDE gives it the name
Label1 by default for the first Label you add.
The error contains the text “')' expected.” and specifies that the error is in
column 33 of line 6.
You can double click an error message in the Error List to jump to the line
of code that caused the error.
For some errors (such as this one), the IDE shows the Error Correction
Options drop-down list and allows you to simply click a link to fix the
error.
◦ The words number1, number2 and total are identifiers for variables
◦ Variables are locations in the computer’s memory where values can be
stored for use by a program.
◦ The variables number1, number2 and total are data of type Integer I
Example: firstNumber.
◦ The message displayed in Fig. 3.10 appears when you run the
application using Debug > Start Debugging (or press F5).
◦ In this case, you can stop running the program by selecting Debug >
Stop Debugging or typing Ctrl + Alt + Break.
Visual Basic also provides unary operators that take only one
operand.
Example: The minus sign: (-2) ,and the plus sign: (+2)
© 1992-2011 by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais 39
© 1992-2011 by Pearson Education, Inc.
All Rights Reserved. - edited by Maysoon
Al-Duwais 40
Mod Operator
Operators in the same row of the table have the same level of
precedence.
2
2
3
3