Visual Basic 6
Course Notes for:
Learn Visual Basic 6.0
© Lou Tylee, 1998
KIDware
15600 NE 8 th, Suite B1-314
Bellevue, WA 98008
(206) 721-2556
FAX (425) 746-4655
ii
Learn Visual Basic 6.0
Notice
These notes were developed for the course, “Learn
Visual Basic 6.0” They are not intended to be a
complete reference to Visual Basic. Consult the
Microsoft Visual Basic Programmer’sGuide and
Microsoft Visual Basic Language Reference Manual
for detailed reference information.
The notes refer to several software and hardware
products by their trade names. These references are for
informational purposes only and all trademarks are the
property of their respective companies.
Lou Tylee
Course Instructor
Contents
iii
Learn Visual Basic 6.0
Contents
1.Introduction to th e Visual Basic Language and
Environment
Preview...................................................................................................................1-1
Course Objectives.................................................................................................1-1
What is VisualBasic?...........................................................................................1-2
Visual Basic 6.0 versus Other Versions of Visual Basic ..................................1-3
16 Bits versus 32 Bits...........................................................................................1-3
Structure of a Visual Basic Application...............................................................1-4
Steps in Developing Application.........................................................................1-4
Drawing the User Interface and Setting Properties...........................................1-5
Example 1-1: Stopwatch Application - Drawing Controls.................................1-9
Setting Properties of Objects at Design Time ................................................ 1-10
Setting Properties at RunTime......................................................................... 1-11
How Names Are Used in Object Events..........................................................1-11
Example 1-2: Stopwatch Application - Setting Properties ............................1-12
Variables .............................................................................................................1-14
Visual Basic Data Types...................................................................................1-14
Variable Declaration..........................................................................................1-14
Example 1-3: Stopwatch Application - Attaching Code................................. 1-18
Quick Primer on Saving Visual Basic Applications ........................................ 1-20
Exercise1: Calendar/Time Display..................................................................1-21
iv
2.
Learn Visual Basic 6.0
The Visual Basic Language
Review and Preview..............................................................................................2-1
A Brief History of Basic.........................................................................................2-1Visual Basic Statements and Expressions ........................................................2-2
Visual Basic Operators.........................................................................................2-3
Visual Basic Functions .........................................................................................2-4
A Closer Look at the RndFunction......................................................................2-5
Example 2-1: Savings Account............................................................................2-6
Visual Basic Symbolic Constants.....................................................................2-10
Defining Your Own Constants ...........................................................................2-10
Visual Basic Branching - If...
Regístrate para leer el documento completo.