You are on page 1of 21

Introduction to Visual Programming

Visual Basic - Powerful Application development tool.

Visual Programming – MS Windows® programming language.

Visual Basic comes in three editions:-


-> Standard Edition – Includes basic controls like Setup Wizard, Icons and Help files.

->Professional Edition – Includes features of Standard Edition plus features like


Crystal Reports, ActiveX and Internet controls.

-> Enterprise Edition – Includes features of Professional Edition plus features like
Remote OLE automation, Component Manager and Remote database access tools. It
is used to build distributed applications.
Features of Visual Basic:-
1. Different options for optimizing compiled code.

2. Supports Client/Server architecture, ActiveX, COM, DCOM & ODBC.

3. New feature ‘IntelliSense’ enables the system to interact with the user while coding.
The IntelliSense features are Quick Info, Complete Word, Data Tips, List Members &
List Constants.

4. Multiple projects can be involved in the IDE at once, saving time for coding & debugging.

5. Bookmarks can be placed for quick search.

6. Property window can be made to list the properties alphabetically or by category.

7. Break points can be toggled using mouse.

8. Using mouse, all highlighted code can be commented or uncommented.


9. Controls can easily be aligned & formatted.

10. Hierarchical Flex Grid, Data Grid Control – Both grids can display a hierarchy of ADO record
sets. Each record set is displayed as a separate row within the grid & can be formatted.

11. ADO – It is a data source control that allow to create a database application with minimum
code.

12. Data List, Data Combo Controls – These controls list the data attached to them via ADODC,
in the form of a ListBox or a ComboBox.

13. Data Time Picker Control – It allows to pick date and time.

14. Data Report – It is used to create reports from any record set.

15. IIS Applications – It allows the user to write server-side Internet applications which use
VB 6.0
Advantages of Visual Basic:-
-> GUI Interface – VB supports Graphical User Interface.

-> Modularization – It consists of small modules where it is clearly indicated what comes into
the module & what goes out, making a program easy to understand.

-> Object Oriented – Programmer thinks of the program as “objects” that interact with each
other.

-> Debugging – VB offers two options for code debugging. One at design & the other at
run-time.

-> Data Access Feature – Databases scalable server-side components for most databases can
be created.
Disadvantages of Visual Basic:-
-> Visual Basic does not fully support Object-Oriented programming concepts.

-> It does not support exception handling.

-> It does not support multi-threading mechanism


Types of Visual Basic Applications:-
1. Standard EXE – It used to create a standard executable file.

2. ActiveX EXE, ActiveX DLL – Building components which do not have a visible interface.
ActiveX EXE is packed as executable file and ActiveX DLL as Dynamic Link Library

3. ActiveX Control – To create his/her own custom controls.

Visual Basic 6.0

Starting with Visual Basic 6.0


4. VB Application Wizard, VB Wizard Manager – Wizard helps to generate a new fully
functional application for the naive user. Wizard Manager helps to build ones’ own
wizard.

5. Data Project – It is one of the features of Enterprise edition and is a standard EXE project
type. It automatically adds controls used for accessing databases to Toolbox. It also includes
Data Report & Data Environment to generate reports & manipulate databases.

Types of Project
6. IIS Applications, DHTML Application – These are used to create Internet Applications for
both server-side & client-side.

7. Addins – Special type of commands that can be added to VB menus, via Add-Ins menu.

8. The Integrated Development Environment (IDE) – VB is an IDE used to develop, run, test
debug application.

9. A Standard EXE Project – Select the Standard EXE icon, highlighted by default & click on ope
button. This opens IDE for Standard EXE projects.

Standard EXE Project


Standard EXE Project
10. Title Bar – It is always at the top of IDE window & displays the name of the project along
with the current form name

11. Menu Bar – It consists of commands required for developing, maintaining & executing
programs with VB.

12. Tool Bar – It provides short cut icons to commonly used menu commands.

Menu Bar
File Icons Run Icons View Icons

Tool Bar
Project Icons Edit Icons
13. Project Window – The Window displaying Project – Project 1 is Project Explorer which
lists the project files.

View code Toggle folders


Project name
Form module
View object

14. Form Designer Window – It allows the user to add controls, graphics & pictures to a form
as need. Every form in an application has its own form designer
15. Tool Box – It consists of prepackaged component controls which can be placed on the
forms to customize them & create great interface.

Pointer Picture Box


Label Text Box
Frame Command Button
Check Box Option Button
Combo Box List Box
Hscroll Bar Vscroll Bar
Timer Drive List Box
Dir List Box File List Box
Shape Line
Image Data
OLE
Tool Box
15. Properties Window – Each control has its own set of properties such as size, color, font,
caption,… When a control on the Form is selected, property window displays the properties
of the selected control.

Properties Window
16. Form Layout Window – It specifies the position of the form on the screen during runtime.

Form Layout Window


16. Immediate Window – It is a debugging tool. When application is running, the user can
pause it & use the immediate window.

Immediate Window
Creating an Application:-
1. Open a standard EXE project to create UI to display the text “Welcome to Visual Basic 6.0”.

2. Setup the properties of Form as required.

3. Add a label control to the Form and setup its properties.

4. Save the project and click run.


Create a program to sum two integers:-
1. Add a Form to new or old project.

2. Create GUI with three labels, three text boxes & two command buttons.
3. Set the properties of the labels, text boxes & command buttons as shown below. Rename
Text1 as txt1, Text2 as txt2, Text3 as txtSum, command1 as cmdAdd & command2 as
cmdExit.

4. Double click on Add button & write the code as shown below. Similarly, do the same for
the Exit button.
5. Save the project and Run the program by clicking start button.

6. If there are multiple forms in a single project, change the startup object. Click on Project.
Go to Project properties. The Project Properties dialog box opens as shown below.
End of Chapter one

You might also like