|This course includes lectures on Microsoft Access|
Visual Basic is used to develop 'rapid applications' inside a windows environment. When we talk about windows we tend to use the term 'object oriented' to describe some of its capabilities. Visual Basic is different from programming languages such as C, Pascal and QBasic, its approach is to respond to events. Visual Basic will allow you to create applications which allows you to
Microsoft Visual Basic uses the principles of the BASIC language (Beginners All-Purpose Symbolic Instruction Code). Due to the advancement of windows programming Microsoft developed the Visual Basic programming language. The emphasis on Visual Basic is to develop Windows applications, an example is shown below (Figure 1.1):
The programming created in Figure 1.1 requires an environment where we can create and modify the application. This is known as the Integrated Development Environment and is discussed in the next section below.
Visual Basic is a high level programming paradigm. Its concepts are based upon Event driven programming. The environment to edit, delete and write code as well as develop windows based applications is known as the 'Integrated Development Environment' (IDE). The development environment for Visual Basic is illustrated below in figure 1.2:
The main components of the Integrated Development Environment (IDE) are illustrated in the subsequent text.
You are able to customise the toolbar by clicking the right mouse button of the toolbar and selecting <Customize> and changing the options you require. The diagram and components of the standard toolbar are illustrated below:
The diagram below shows the main tools that appear on the standard Toolbox window. These are called the intrinsic controls because all three editions of VB support these standard tools. You can add additional controls to the toolbox as your needs grow. Some extra tools come with all three editions of VB, but these extra tools do not appear on the Toolbox window until you add them through the <Project | Components> menu option.
All standard components of Windows interfaces can be created here. The Toolbox is selected by choosing Toolbox menu from the View menu.
The Form window is your primary work area where the visual development of the application is created or modified. Although the Form window first appears small relative to the rest of the screen, the Form window comprises the background of the application.
Note:It is important when creating an interface to use a appropriate design methodology and avoid taking an 'objects on the screen' approach.
The Form window holds the program's interactive objects, to view the code for the Form window or any object we can Select <View | Code >. The Code window is little more than a text editor with which you write the programming statements that tie the application together.
An alternative technique to view the code is to double click anywhere on the form or the object and view the code for that particular object. The diagram shows the Code Window for the form.
The parts of the application that you create, such as the forms, the code, and the graphics that you prepare for output, comprise the source program. The code listing below gives an example of code that is incorporated in a typical application:
Private Sub txtJAN_KeyPress(KeyAscii As Integer) Call TEST(KeyAscii, txtFEB) End Sub _______________________________________________
When you or another user compiles or runs the source program, VB translates the program into an executable program. You cannot make changes directly to an executable program. If you see bugs when you run the program, you must change the source application (which might contain multiple files in the project) and rerun or recompile the source.
The Project Explorer was used to celebrate the resemblance of the window to the typical Explorer-like tree-structured file views so prevalent in Windows 95 and 98/2000. You can expand and collapse branches of the view to get more or less detail.
The Project Explorer window displays forms, modules (files that hold supporting code for the application), classes (advanced modules), and more. When you want to work with a particular part of the loaded application, double-click the component in the Project window to bring that component into focus.
In other words, if the Project Explorer window displays three forms and you need to edit one of the forms, locate and double-click the form name in the Project window to activate that form in the Form window.
The property window represents an objects associated properties. Each property of a control such as a Label, command button etc. has its own unique set of properties.
The property window is viewed by pressing the shortcut key F4.
The chapter focused on the Visual Basic environment. Describing the main components of the application, including the Toolbox, properties windows and Code Window. These environments will be used throughout the duration of this course.
To run the application
|Contact Vas Rabani for any comments on the website or queries|