Teach yourself visual basic / PDF
Teach yourself visual basic / PDF
What is Visual Basic?
· 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.
· Some Features of Visual Basic
Þ Full set of objects - you 'draw' the application
Þ Lots of icons and pictures for your use
Þ Response to mouse and keyboard actions
Þ Clipboard and printer access
Þ Full array of mathematical, string handling, and graphics functions
Þ Can handle fixed and dynamic variable and control arrays
Þ Sequential and random access file support
Þ Useful debugger and error-handling facilities
Þ Powerful database access tools
Þ ActiveX support
Þ Package & Deployment Wizard makes distributing your applications simple
Visual Basic 6.0 versus Other Versions of Visual Basic
· 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
Þ New ActiveX data control object
Þ Allows database integration with wide variety of applications
Þ New data report designer
Þ New Package & Deployment Wizard
Þ Additional internet capabilites
16 Bits versus 32 Bits
· 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
Structure of a Visual Basic Application
Application (Project) is made up of:
Þ Forms - Windows that you create for user interface
Þ Controls - Graphical features drawn on forms to allow user interaction (text boxes, labels, scroll bars, command buttons, etc.) (Forms and Controls are objects.)
Þ Properties - Every characteristic of a form or control is specified by a property. Example properties include names, captions, size, color, position, and contents. Visual Basic applies default properties. You can
change properties at design time or run time.
Þ 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.
Þ Modules - Collection of general procedures, variable declarations, and constant definitions used by application.
Steps in Developing Application
· There are three primary steps involved in building a Visual Basic application:
We’ll look at each step.
Drawing the User Interface and Setting Properties
· Visual Basic operates in three modes.
Þ Design mode - used to build application
Þ Run mode - used to run the application
Þ Break mode - application halted and debugger is available
We focus here on the design mode.
· Six windows appear when you start Visual Basic.
Þ The Main Window consists of the title bar, menu bar, and toolbar. Th title bar indicates the project name, the current Visual Basic operating mode, and the current form. The menu bar has drop-down menus from which you control the operation of the Visual Basic environment. The toolbar has buttons that provide shortcuts to some of the menu options.
The main window also shows the location of the current form relative to the upper left corner of the screen (measured in twips) and the width and length of the current form........
Teach yourself visual basic / PDF
What is Visual Basic?
· 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.
· Some Features of Visual Basic
Þ Full set of objects - you 'draw' the application
Þ Lots of icons and pictures for your use
Þ Response to mouse and keyboard actions
Þ Clipboard and printer access
Þ Full array of mathematical, string handling, and graphics functions
Þ Can handle fixed and dynamic variable and control arrays
Þ Sequential and random access file support
Þ Useful debugger and error-handling facilities
Þ Powerful database access tools
Þ ActiveX support
Þ Package & Deployment Wizard makes distributing your applications simple
Visual Basic 6.0 versus Other Versions of Visual Basic
· 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
Þ New ActiveX data control object
Þ Allows database integration with wide variety of applications
Þ New data report designer
Þ New Package & Deployment Wizard
Þ Additional internet capabilites
16 Bits versus 32 Bits
· 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
Structure of a Visual Basic Application
Application (Project) is made up of:
Þ Forms - Windows that you create for user interface
Þ Controls - Graphical features drawn on forms to allow user interaction (text boxes, labels, scroll bars, command buttons, etc.) (Forms and Controls are objects.)
Þ Properties - Every characteristic of a form or control is specified by a property. Example properties include names, captions, size, color, position, and contents. Visual Basic applies default properties. You can
change properties at design time or run time.
Þ 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.
Þ Modules - Collection of general procedures, variable declarations, and constant definitions used by application.
Steps in Developing Application
· There are three primary steps involved in building a Visual Basic application:
- 1. Draw the user interface
- 2. Assign properties to controls
- 3. Attach code to controls
We’ll look at each step.
Drawing the User Interface and Setting Properties
· Visual Basic operates in three modes.
Þ Design mode - used to build application
Þ Run mode - used to run the application
Þ Break mode - application halted and debugger is available
We focus here on the design mode.
· Six windows appear when you start Visual Basic.
Þ The Main Window consists of the title bar, menu bar, and toolbar. Th title bar indicates the project name, the current Visual Basic operating mode, and the current form. The menu bar has drop-down menus from which you control the operation of the Visual Basic environment. The toolbar has buttons that provide shortcuts to some of the menu options.
The main window also shows the location of the current form relative to the upper left corner of the screen (measured in twips) and the width and length of the current form........
0 commentaires: