Visual Basic 6 Notes
Visual Basic 6 Notes
Preview
In this first class, we will do a quick overview of how to build an application in Visual Basic. You’ll
learn a new vocabulary, a new approach to programming, and ways to move around in the
Visual Basic environment. You will leave having written your first Visual Basic program.
Course Objectives
⇒ Understand the benefits of using Microsoft Visual Basic 6.0 for Windows as an application
tool
⇒ Understand the Visual Basic event-driven programming concepts, terminology, and available
tools
⇒ Learn to use the Visual Basic toolbox ⇒ Learn to modify object properties ⇒ Learn object
methods
⇒ Use the menu design window ⇒ Understand proper debugging and error-handling
procedures
⇒ Gain a basic understanding of database access and management using databound controls
• Visual Basic is a tool that allows you to develop Windows (Graphic User Interface - GUI)
applications. The applications have a familiar appearance to the user.
• Visual Basic is event-driven, meaning code remains idle until called upon to respond to some
event (button pressing, menu selection, ...). Visual Basic is governed by an event processor.
Nothing happens until an event is detected. Once an event is detected, the code corresponding
to that event (event procedure) is executed. Program control is then returned to the event
processor.
⇒ Lots of icons and pictures for your use ⇒ Response to mouse and keyboard actions
⇒ Clipboard and printer access Event Procedures ⇒ Full array of mathematical, string handling,
and graphics functions
⇒ ActiveX support
• The original Visual Basic for DOS and Visual Basic For Windows were introduced in 1991.
• Visual Basic 3.0 (a vast improvement over previous versions) was released in 1993.
• Visual Basic 4.0 released in late 1995 (added 32 bit application support).
• • Visual Basic 5.0 released in late 1996. New environment, supported creation of ActiveX
controls, deleted 16 bit application support.
• And, now Visual Basic 6.0 - some identified new features of Visual Basic 6.0:
⇒ Faster compiler
• Applications built using the Visual Basic 3.0 and the 16 bit version of Visual Basic 4.0 will run
under Windows 3.1, Windows for Workgroups, Windows NT, or Windows 95
• Applications built using the 32 bit version of Visual Basic 4.0, Visual Basic 5.0 and Visual Basic
6.0 will only run with Windows 95 or Windows NT (Version 3.5.1 or higher). • In this class, we
will use Visual Basic 6.0 under Windows 95, recognizing such applications will not operate in 16
bit environments.
⇒ Controls - Graphical features drawn on forms to allow user interaction (text boxes, labels,
scroll bars, command buttons, etc.) (Forms and Controls are objects.)
⇒ Methods - Built-in procedure that can be invoked to impart some action to a particular
object.
⇒ Event Procedures - Code related to some object. This is the code that is executed when a
certain event occurs.
⇒ General Procedures - Code not related to objects. This code must be invoked by the
application.
• There are three primary steps involved in building a Visual Basic application: