SlideShare a Scribd company logo
PRESENTATION
ON
VISUAL BASIC
INTRODUCTION TO
UNIT -1 INTRODUCTION TO VB
Getting started with VB6 , Programming
Environment, Working with Forms ,
Developing an applications, Variables, Data
types and Modules, procedures and control
structures, array, working with controls :
Creating and using controls, working with
control arrays.
INTRODUCTION TOVISUAL BASIC 6.0
 What is Visual Basic?
Visual Basic is a third-generation event-driven programming
language and Integrated Development Programming (IDE) first
released by Microsoft in 1991 for its COM Programming
Model . It evolved from the earlier DOS version called
BASIC. BASIC means :-
Beginners' All-purpose Symbolic Instruction Code. Since
then Microsoft has released many versions ofVisual Basic, from
Visual Basic 1.0 to the final versionVisual Basic 6.0.Visual Basic
is a user-friendly programming language designed for beginners,
and it enables anyone to develop GUI window applications
easily.
UNIT - 1 VISUAL BASIC PRESENTATION FOR IT
HISTORY OF VISUAL BASIC
• Alan Cooper developed Visual Basic in 1988 and
sold to Microsoft
• VB1 Debuts at Windows World in March
20,1991
• VB2 Debuts in November 1992
• VB3 Debuts in June 1993
• VB4 Debuts in October 1996
• VB5 Debuts in April 1997
• VB6 Debuts in October 1998
THREE EDITIONS OF VISUAL BASIC
1. The Visual Basic Learning edition is the introductory
edition that lets you easily create Windows applications.
2. The Visual Basic Professional Edition is for computer
professionals and has features such as tools to develop
ActiveX and Internet controls.
3. The Visual Basic Enterprise edition is the most advanced
edition and is aimed to programmers who build distributed
applications in a team environment.
TYPES OF APPLICATIONS
CREATED IN VB 6.0
1. Standard EXE
2. ActiveX EXE, ActiveX DLL
3. ActiveX Control
4. VB Application Wizard ,VB Wizard Manager
5. ActiveX Document EXE, ActiveX Document DLL
6. AddIn
7. Data Project
8. DHTML Application
9. IIS Application
10. VB Enterprise Edition Controls
FEATURES OF VISUAL BASIC
1. It is a simple language.
2. It supports Integrated Development Environment(IDE), as multiple projects
can be opened.
3. The lines of codes are Compiled Automatically with a faster compiler.
4. It completes the word automatically.
5. Bookmarks can be placed for quick search.
6. Break points can be toggled easily.
7. Drag and drop facility Clipboard and printer access.
8. Handle fixed and dynamic variable and control arrays.
9. Sequential random access file, and Binary access file support.
ADVANTAGES OF VISUAL BASIC
A. The structure of the Basic programming language is very simple, particularly as
to the executable code.
B. VB is not only a language but primarily an integrated, interactive development
environment ("IDE").
The VB-IDE has been highly optimized to support rapid application
development ("RAD"). It is particularly easy to develop graphical user interfaces
and to connect them to handler functions provided by the application.
C. The graphical user interface of the VB-IDE provides intuitively appealing
views for the management of the program structure in the large and the various
types of entities (classes, modules, procedures, forms).
D. VB is attuned to Microsoft’s Computer Object Model(“COM”).
STARTING VISUAL BASIC 6.0
VISUAL BASIC 6.0 PROGRAMMING WINDOW
1. Title bar:- The top of the window with the name of the
project.
2. The Menu Bar:- Displays the commands required to build
an application.
3. The Tool Bars:- Provides shortcut icons for quick access to
the commonly used commands.
4. The Project Explorer window:- It shows the various
elements of a project namely form, classes
and modules.
5. The Properties Window:- Exposes the various
characteristics of selected
objects
While your project is running, the user can do many things, such
as move mouse around; click on either button; move, resize or
close your form’s window; or jump to another application. Each
action by the user causes an event to occur in yourVisual Basic
Project.
VB ignores events for which no procedures are written.
Visual Basic automatically names your event procedures.The name
consist of the object name, an underscore(_), and the name of
event. For example: the click event of command button called
cmdPush will be cmdPush_Click().
MOUSE EVENTS KEYBOARD EVENTS
FOCUS EVENTS
DATE
S
T
R
I
N
G
B
Y
T
E
V
A
R
I
A
N
T
OBJECT
Data types
supported
BOOLEAN
NUMERIC
VARIABLES
DECLARING VARIABLES
EXPLICIT
DECLARATION
IMPLICIT
DECLARARTION
USING OPTION
EXPLICIT
STATEMENT
SCOPE OFVARIABLES
LOCAL
VARIABL
E
GLOBAL
VARIABL
E
MODULE
LEVEL
VARIABL
E
CONSTANTS
USER
DEFINED
CONSTATNT
S
SYSTEM
DEFINED
CONSTANTS
(PREDEFINED)
OPERATORS
ARITHMETIC OPERATORS
RELATIONAL OPERATORS
LOGICAL OPERATORS
TYPE CONVERSIONS
DATA TYPES, MODULES
DATA TYPES
• A program can’t do anything until you have reserved a
space in memory for the values used in it
• This is called declaration of variables
• When you declare a variable you must:
• Give it a sensible name
• Give it a data type depending on what kind of value
it will hold
• Ask yourself will it hold just letters or whole numbers
or numbers with a decimal point or dates…..etc
BASIC DATA TYPES
• Short
• whole numbers in the range –32,768 to 32,767
• Examples: -32 or 10,000
• needs 2 bytes of storage space
• Integer
• A whole number in the range –2 billion to + 2 billion
• Examples: 20,000,000 or -400,000
• needs 4 bytes of storage
BASIC DATA TYPES
• Single
• Numbers with decimal places and fractions
• in the range -3.402823E38 to –1.401298E-45 for negative values and 1.401298E-
45 to 3.4o2823E38 for positive
• Examples: 3·142, -700·75
• Takes 4 bytes of storage
• Double
• For incredibly large or small values use a double, as a single wont provide the
range or accuracy that you need
• Takes 8 bytes of storage
• Bear this last fact in mind, if you don’t need this level of accuracy, declare a single
as it uses half the storage space
VARIABLES - NAMING
CONVENTIONS
• Hungarian notation is used in naming variables
• This is accepted as good programming practice
• Prefix the variable name with a 3 letter identifier to
indicate the data type
• The variable name should be meaningful - good
programmers can read the code of a program and know
what it does
• You will need to use these conventions
VARIABLES
• Prefixes
sht = short dte = date
int = integer dec = decimal
sng = single bln = boolean
dbl = double str = string
CONSTANTS
• Use a Constant where a value is needed but does not
change while program is running
• e.g. VAT, Annual Leave, Pi, Gravity
• Constants are always global as they are only set up once
• This allows for easy program modification if value
changes
• We don’t use a Dim statement, but use
• Const dblPi as double = 3.147
• Const sngGravity as single = 9.8
VISUAL BASIC CONTROLS
INTRINSIC CONTROL
The visual toolbox contains the tool we use to draw controls on your frames.
Intrinsic controls are one of them. It contain command button and frame
controls.
It include in the .Exe file.
Basic controls are :
• Checkbox- displays a true/false or yes/no option. You can check any
number of checkboxes on a form at one time.
• Combo box- a textbox with a list box , allows user to type in a selection
or select an item from a drop-down list.
• Command button- carries out a command or action when user chooses
it.
• Enables you to connect to an existing databases and display
information from it on your forms.
• Label- displays text a user cannot interact with or modify.
• Listbox -displays a list of items that user can choose
from .
Option button – the option button control , as part of an option
group with other option buttons, displays multiple choices from
which a user can choose only one.
Picture box- displays bitmap , icons or window metafiles, JPEG
or GIF files. It also displays text or cats as a visual contains for
other controls.
 Textbox- provides an area to enter or display text.
 Timer – Executes time events at specified time intervals.
 OLE container – Enables data into a visual basic application.
 Image – displays bitmaps , icons or window metafiles ,JPEG or GIF files, acts like a
command button when clicked.
 Scrollbar – allow user to add scroll bars to control that do not automatically provide them.
 Frame – provides a visual and functional container for controls .
• The most useful intrinsic controls
these are nine intrinsic controls are pretty much used on every VB application .start your
learning with these and then branch out .
command button, image , checkbox, picture box , text box, list box ,label , combo box ,
option button.
STANDARD ACTIVEX CONTROLS
The learning edition of visual basic contains a number of
activex controls (referred to as standard activex controls) that
allow you to add advanced features to your applications.
Activex controls have the file name extension .
Ocx and can be used in your project by manually adding them
to the toolbox.
The following table summarizes the standard activex controls
available in the learning edition of visual basic.
Icon Control name Class name Description
ADO Data Control ADODC
Creates a connection to a database using ADO.
Assignable to the DataSource property of other
controls such as the DataGrid.
Common dialog CommonDialog Provides a standard set of dialog boxes for operations
such as opening and saving files, setting print
options, and selecting colors and fonts.
DataCombo DataCombo
Provides most of the features of the standard combo
box control, plus increased data access capabilities.
DataGrid DataGrid
A grid control that allows can be data-bound to a
data source such as the ADO Data Control. Reading
and editing the recordset is possible.
DataList DataList Provides most of the features of the standard list box
control, plus increased data access capabilities.
Microsoft
Hierarchical
FlexGrid
MSHFlexGrid A read-only grid control that can be bound the Data
Environment designer to show hierarchical
recordsets.
OTHER CONTROLS
Other ActiveX controls included with all versions of Visual Basic
are documented in the Component Tools Guide, and include
the following: ImageCombo, ImageList, ListView, ProgressBar,
Slider, Statusbar, TabStrip, Toolbar, and TreeView.
ADDING AND REMOVING ACTIVEX CONTROLS
You move ActiveX controls to and from the toolbox using the following
procedures.
To add an ActiveX control to the toolbox
From the Project menu, choose Components.
Select the check box next to the name of the .ocx control, and then
choose OK. Once a control is placed in the toolbox, you can add it to a
form just as you would an intrinsic control.
To remove an ActiveX control
Remove all instances of the control from the forms in your project.
Delete any references to the control in the project's code. If references
to a deleted control are left in your code, an error message will
display when you compile the application.
From the Project menu, choose Components.
Clear the check box next to the name of the .ocx control, and then
choose OK. An error message will display if there are remaining
instances of the control in your project.
COMMON DIALOG CONTROL:
• VB provides user facility of using in-built dialog boxes in
application. Hence user is saved from the job of design his own
dialog boxes. He has just to use common dialog control on form
and call appropriate methods. Common dialog control is a special
control. It provides its services to application but it need not to be
displayed at form at run time.
• Common dialog control is a component that allows us to access
inbuilt libraries.
• Common dialog control provides an interface between visual basic
and the procedures in the microsoft windows.
TO USE THE COMMON DIALOG
CONTROL:
• Add the common dialog control to the toolbox by
selecting components from the project menu.
Locate and select the control in the controls
tabbed dialog, then click the OK button.
• On the toolbox, click the common Dialog control
and draw it on a form. When you draw a common
dialog control on a form, it automatically resize
itself. Like the timer control, this dialog is invisible
at run time.
The common dialog control allows you to display these commonly used dialog
boxes:
• Open
• Save As
• Color
• Font
• Print
• Help
• File open and file save common dialog control: File common dialog
doesn’t display all files in any given folder normally. File display are limited
to those recognized by application. Filter property determines the file to be
displayed in File Open or File Save dialog box. DefaultExt property is used to
specify the type of file to be displayed.
• Color Common Dialog Control: It has single property color which returns
color selected by user or sets initially selected color when dialog box opened.
• Font common dialog box: It lets user select and view font, font size and
style. Following attributes are set- Color, Font Bold, Font Italic,
FontStrikethru, Font Underline, Font Name, Font Size.
• Print Common Dialog Box: It enables user to select printer, set certain
properties of printout like number of copies, number of pages.
• Help common Dialog Control: Before using help common
dialog box , user must have help files. These files either can be
prepared by user or in-built.
• To display common dialog box through code, its action
property must be set.
Method Action
ShowOpen Displays open dialog box
ShowSave Displays Save as dialog box
ShowColor Displays Color dialog box
ShowFont Displays Font dialog box
ShowPrinter Displays Printer Dialog box
ShowHelp InvokesWindows help engine
THANK YOU !

More Related Content

PPTX
control structure in visual basic
PPTX
Introduction to visual basic 6 (1)
DOCX
Vb lecture
PPTX
TVL ICT_Introduction to Visual Basic.pptx
PPT
VB6_INTRODUCTION.ppt
PPTX
Introduction to Visual Basic Programming
PPTX
LESSON1-INTRODUCTION-TO-VISUALBASIC-1.pptx
PPTX
LESSON1-INTRODUCTION-TO-VISUALBASIC-1.pptx
control structure in visual basic
Introduction to visual basic 6 (1)
Vb lecture
TVL ICT_Introduction to Visual Basic.pptx
VB6_INTRODUCTION.ppt
Introduction to Visual Basic Programming
LESSON1-INTRODUCTION-TO-VISUALBASIC-1.pptx
LESSON1-INTRODUCTION-TO-VISUALBASIC-1.pptx

Similar to UNIT - 1 VISUAL BASIC PRESENTATION FOR IT (20)

PPTX
Programming basics
PDF
Introduction to Visual Basic 6.0
PDF
Unit -II Introduction to visual programming.pdf
PPTX
Introduction to Visual Basic 6.0 Fundamentals
PDF
VB PPT by ADI part-1.pdf
PDF
Vb 6ch123
PDF
Electrical shop management system project report.pdf
PDF
outgoing again
PPS
Vb6.0 Introduction
PPT
Vb basics
PDF
Introduction To Computer Programming And Numerical Methods 1st Edition Xundon...
PPTX
Visual basic
PPTX
Visual BAsic Softwares intended for ICT students
PPT
Ms vb
PPTX
Visual Basic.pptx
PPTX
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
PDF
VB PPT by ADI part-1.pdf
DOCX
Online advertising management system
Programming basics
Introduction to Visual Basic 6.0
Unit -II Introduction to visual programming.pdf
Introduction to Visual Basic 6.0 Fundamentals
VB PPT by ADI part-1.pdf
Vb 6ch123
Electrical shop management system project report.pdf
outgoing again
Vb6.0 Introduction
Vb basics
Introduction To Computer Programming And Numerical Methods 1st Edition Xundon...
Visual basic
Visual BAsic Softwares intended for ICT students
Ms vb
Visual Basic.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
VB PPT by ADI part-1.pdf
Online advertising management system
Ad

Recently uploaded (20)

PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Insiders guide to clinical Medicine.pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
Cell Structure & Organelles in detailed.
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
VCE English Exam - Section C Student Revision Booklet
Week 4 Term 3 Study Techniques revisited.pptx
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Final Presentation General Medicine 03-08-2024.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Supply Chain Operations Speaking Notes -ICLT Program
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Microbial disease of the cardiovascular and lymphatic systems
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Cell Types and Its function , kingdom of life
102 student loan defaulters named and shamed – Is someone you know on the list?
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Anesthesia in Laparoscopic Surgery in India
Insiders guide to clinical Medicine.pdf
Pre independence Education in Inndia.pdf
Cell Structure & Organelles in detailed.
Ad

UNIT - 1 VISUAL BASIC PRESENTATION FOR IT

  • 3. UNIT -1 INTRODUCTION TO VB Getting started with VB6 , Programming Environment, Working with Forms , Developing an applications, Variables, Data types and Modules, procedures and control structures, array, working with controls : Creating and using controls, working with control arrays.
  • 4. INTRODUCTION TOVISUAL BASIC 6.0  What is Visual Basic? Visual Basic is a third-generation event-driven programming language and Integrated Development Programming (IDE) first released by Microsoft in 1991 for its COM Programming Model . It evolved from the earlier DOS version called BASIC. BASIC means :- Beginners' All-purpose Symbolic Instruction Code. Since then Microsoft has released many versions ofVisual Basic, from Visual Basic 1.0 to the final versionVisual Basic 6.0.Visual Basic is a user-friendly programming language designed for beginners, and it enables anyone to develop GUI window applications easily.
  • 6. HISTORY OF VISUAL BASIC • Alan Cooper developed Visual Basic in 1988 and sold to Microsoft • VB1 Debuts at Windows World in March 20,1991 • VB2 Debuts in November 1992 • VB3 Debuts in June 1993 • VB4 Debuts in October 1996 • VB5 Debuts in April 1997 • VB6 Debuts in October 1998
  • 7. THREE EDITIONS OF VISUAL BASIC 1. The Visual Basic Learning edition is the introductory edition that lets you easily create Windows applications. 2. The Visual Basic Professional Edition is for computer professionals and has features such as tools to develop ActiveX and Internet controls. 3. The Visual Basic Enterprise edition is the most advanced edition and is aimed to programmers who build distributed applications in a team environment.
  • 8. TYPES OF APPLICATIONS CREATED IN VB 6.0 1. Standard EXE 2. ActiveX EXE, ActiveX DLL 3. ActiveX Control 4. VB Application Wizard ,VB Wizard Manager 5. ActiveX Document EXE, ActiveX Document DLL 6. AddIn 7. Data Project 8. DHTML Application 9. IIS Application 10. VB Enterprise Edition Controls
  • 9. FEATURES OF VISUAL BASIC 1. It is a simple language. 2. It supports Integrated Development Environment(IDE), as multiple projects can be opened. 3. The lines of codes are Compiled Automatically with a faster compiler. 4. It completes the word automatically. 5. Bookmarks can be placed for quick search. 6. Break points can be toggled easily. 7. Drag and drop facility Clipboard and printer access. 8. Handle fixed and dynamic variable and control arrays. 9. Sequential random access file, and Binary access file support.
  • 10. ADVANTAGES OF VISUAL BASIC A. The structure of the Basic programming language is very simple, particularly as to the executable code. B. VB is not only a language but primarily an integrated, interactive development environment ("IDE"). The VB-IDE has been highly optimized to support rapid application development ("RAD"). It is particularly easy to develop graphical user interfaces and to connect them to handler functions provided by the application. C. The graphical user interface of the VB-IDE provides intuitively appealing views for the management of the program structure in the large and the various types of entities (classes, modules, procedures, forms). D. VB is attuned to Microsoft’s Computer Object Model(“COM”).
  • 12. VISUAL BASIC 6.0 PROGRAMMING WINDOW
  • 13. 1. Title bar:- The top of the window with the name of the project. 2. The Menu Bar:- Displays the commands required to build an application. 3. The Tool Bars:- Provides shortcut icons for quick access to the commonly used commands.
  • 14. 4. The Project Explorer window:- It shows the various elements of a project namely form, classes and modules. 5. The Properties Window:- Exposes the various characteristics of selected objects
  • 15. While your project is running, the user can do many things, such as move mouse around; click on either button; move, resize or close your form’s window; or jump to another application. Each action by the user causes an event to occur in yourVisual Basic Project. VB ignores events for which no procedures are written. Visual Basic automatically names your event procedures.The name consist of the object name, an underscore(_), and the name of event. For example: the click event of command button called cmdPush will be cmdPush_Click().
  • 16. MOUSE EVENTS KEYBOARD EVENTS FOCUS EVENTS
  • 28. DATA TYPES • A program can’t do anything until you have reserved a space in memory for the values used in it • This is called declaration of variables • When you declare a variable you must: • Give it a sensible name • Give it a data type depending on what kind of value it will hold • Ask yourself will it hold just letters or whole numbers or numbers with a decimal point or dates…..etc
  • 29. BASIC DATA TYPES • Short • whole numbers in the range –32,768 to 32,767 • Examples: -32 or 10,000 • needs 2 bytes of storage space • Integer • A whole number in the range –2 billion to + 2 billion • Examples: 20,000,000 or -400,000 • needs 4 bytes of storage
  • 30. BASIC DATA TYPES • Single • Numbers with decimal places and fractions • in the range -3.402823E38 to –1.401298E-45 for negative values and 1.401298E- 45 to 3.4o2823E38 for positive • Examples: 3·142, -700·75 • Takes 4 bytes of storage • Double • For incredibly large or small values use a double, as a single wont provide the range or accuracy that you need • Takes 8 bytes of storage • Bear this last fact in mind, if you don’t need this level of accuracy, declare a single as it uses half the storage space
  • 31. VARIABLES - NAMING CONVENTIONS • Hungarian notation is used in naming variables • This is accepted as good programming practice • Prefix the variable name with a 3 letter identifier to indicate the data type • The variable name should be meaningful - good programmers can read the code of a program and know what it does • You will need to use these conventions
  • 32. VARIABLES • Prefixes sht = short dte = date int = integer dec = decimal sng = single bln = boolean dbl = double str = string
  • 33. CONSTANTS • Use a Constant where a value is needed but does not change while program is running • e.g. VAT, Annual Leave, Pi, Gravity • Constants are always global as they are only set up once • This allows for easy program modification if value changes • We don’t use a Dim statement, but use • Const dblPi as double = 3.147 • Const sngGravity as single = 9.8
  • 35. INTRINSIC CONTROL The visual toolbox contains the tool we use to draw controls on your frames. Intrinsic controls are one of them. It contain command button and frame controls. It include in the .Exe file. Basic controls are : • Checkbox- displays a true/false or yes/no option. You can check any number of checkboxes on a form at one time. • Combo box- a textbox with a list box , allows user to type in a selection or select an item from a drop-down list. • Command button- carries out a command or action when user chooses it.
  • 36. • Enables you to connect to an existing databases and display information from it on your forms. • Label- displays text a user cannot interact with or modify. • Listbox -displays a list of items that user can choose from . Option button – the option button control , as part of an option group with other option buttons, displays multiple choices from which a user can choose only one. Picture box- displays bitmap , icons or window metafiles, JPEG or GIF files. It also displays text or cats as a visual contains for other controls.
  • 37.  Textbox- provides an area to enter or display text.  Timer – Executes time events at specified time intervals.  OLE container – Enables data into a visual basic application.  Image – displays bitmaps , icons or window metafiles ,JPEG or GIF files, acts like a command button when clicked.  Scrollbar – allow user to add scroll bars to control that do not automatically provide them.  Frame – provides a visual and functional container for controls . • The most useful intrinsic controls these are nine intrinsic controls are pretty much used on every VB application .start your learning with these and then branch out . command button, image , checkbox, picture box , text box, list box ,label , combo box , option button.
  • 38. STANDARD ACTIVEX CONTROLS The learning edition of visual basic contains a number of activex controls (referred to as standard activex controls) that allow you to add advanced features to your applications. Activex controls have the file name extension . Ocx and can be used in your project by manually adding them to the toolbox. The following table summarizes the standard activex controls available in the learning edition of visual basic.
  • 39. Icon Control name Class name Description ADO Data Control ADODC Creates a connection to a database using ADO. Assignable to the DataSource property of other controls such as the DataGrid. Common dialog CommonDialog Provides a standard set of dialog boxes for operations such as opening and saving files, setting print options, and selecting colors and fonts. DataCombo DataCombo Provides most of the features of the standard combo box control, plus increased data access capabilities. DataGrid DataGrid A grid control that allows can be data-bound to a data source such as the ADO Data Control. Reading and editing the recordset is possible. DataList DataList Provides most of the features of the standard list box control, plus increased data access capabilities. Microsoft Hierarchical FlexGrid MSHFlexGrid A read-only grid control that can be bound the Data Environment designer to show hierarchical recordsets.
  • 40. OTHER CONTROLS Other ActiveX controls included with all versions of Visual Basic are documented in the Component Tools Guide, and include the following: ImageCombo, ImageList, ListView, ProgressBar, Slider, Statusbar, TabStrip, Toolbar, and TreeView.
  • 41. ADDING AND REMOVING ACTIVEX CONTROLS You move ActiveX controls to and from the toolbox using the following procedures. To add an ActiveX control to the toolbox From the Project menu, choose Components. Select the check box next to the name of the .ocx control, and then choose OK. Once a control is placed in the toolbox, you can add it to a form just as you would an intrinsic control.
  • 42. To remove an ActiveX control Remove all instances of the control from the forms in your project. Delete any references to the control in the project's code. If references to a deleted control are left in your code, an error message will display when you compile the application. From the Project menu, choose Components. Clear the check box next to the name of the .ocx control, and then choose OK. An error message will display if there are remaining instances of the control in your project.
  • 43. COMMON DIALOG CONTROL: • VB provides user facility of using in-built dialog boxes in application. Hence user is saved from the job of design his own dialog boxes. He has just to use common dialog control on form and call appropriate methods. Common dialog control is a special control. It provides its services to application but it need not to be displayed at form at run time. • Common dialog control is a component that allows us to access inbuilt libraries. • Common dialog control provides an interface between visual basic and the procedures in the microsoft windows.
  • 44. TO USE THE COMMON DIALOG CONTROL: • Add the common dialog control to the toolbox by selecting components from the project menu. Locate and select the control in the controls tabbed dialog, then click the OK button. • On the toolbox, click the common Dialog control and draw it on a form. When you draw a common dialog control on a form, it automatically resize itself. Like the timer control, this dialog is invisible at run time.
  • 45. The common dialog control allows you to display these commonly used dialog boxes: • Open • Save As • Color • Font • Print • Help
  • 46. • File open and file save common dialog control: File common dialog doesn’t display all files in any given folder normally. File display are limited to those recognized by application. Filter property determines the file to be displayed in File Open or File Save dialog box. DefaultExt property is used to specify the type of file to be displayed. • Color Common Dialog Control: It has single property color which returns color selected by user or sets initially selected color when dialog box opened. • Font common dialog box: It lets user select and view font, font size and style. Following attributes are set- Color, Font Bold, Font Italic, FontStrikethru, Font Underline, Font Name, Font Size. • Print Common Dialog Box: It enables user to select printer, set certain properties of printout like number of copies, number of pages.
  • 47. • Help common Dialog Control: Before using help common dialog box , user must have help files. These files either can be prepared by user or in-built. • To display common dialog box through code, its action property must be set. Method Action ShowOpen Displays open dialog box ShowSave Displays Save as dialog box ShowColor Displays Color dialog box ShowFont Displays Font dialog box ShowPrinter Displays Printer Dialog box ShowHelp InvokesWindows help engine