SlideShare a Scribd company logo
Visual basic programming
Visual basic programming
Text box:
In order to display or accept user input in the form of text like
name, customer ID, ETC., Visual basic provides you with this
controls. It is used to display text and allows the user to edit the data
in the box. A text box control is also called an edit field or edit
control. It displays the information entered at design time, entered by
the user, or assigned to the control in code at run time.
Command button:
Creates a button that the user can choose to carry out a
command. The user will click on this button and the computer will
perform the task associated with the button.
Activity does not stop with the invoice that you have generated.
A copy may have to be sent to the commercial tax department, the
credit card company, the head office, and so on.
Label box:
It allows you to display text that you don’t want the user to
change, such as a caption under a graphic. When you want to print
the voices, you need to know if the customer is going to pay by
cash or toque, or credit card. This means that the billing clerk has
to select one from the various options available. For this Visual
basic has the option button control.
Check box:
Creates a box that the user can easily choose to indicate if
something is true or false, or to display multiple choices when the
user can choose more than one. There are many more controls that
Visual basic provides that may not be used in the immediate
context. Let us take a look at the other controls that are part of the
standard set of controls available on the toolbox.
Combo box:
The user can either choose an item from the list or
enter a value in the text box. The new value entered can
be added to the existing data. The list box and the combo
box display data usually from a database. In order to
access data and to manipulate data in a database like
access, SQL server, etc. Visual basic provides a control
called the data control.
Image control:
This is very similar to the pictures box control. Images
displayed in an image control can only be decorative and
use fewer resources than a pictures box.
Visual basic programming
 Moving from one drive to another : The DriveListBox
 Moving from one directory to another : DirListBox
 List file(s) in a dictionary : FileListBox
 The DriveListBox control:
This is a drop-down list box that will display the list
of drives on your computer. It gets all information from the
operating system and allows the user to select a drive of the
choice. Selecting a particular drive records a change in the
Drive property of the DriveListBox.
 The DirListBox control:
A drop-down list box that displays a hierarchical list of
directories in the current drive.
 The FileListBox:
Displays all files in the current Directory or Folder.
Allows users to set up search criteria for files.
These three controls used together can create an
elegant interface that will allow the user to locate a file on
his computer without any sweat.
Add the Common Dialog control to your toolbox by
Right clicking on the toolbox and selecting ‘Components’
from the pop-up menu. Next select ‘Microsoft common
dialog control 6.0 from the list of components. You will see
this as a control on your toolbox.
Draw it on your form. Please note that this control does
not have an interface that the user will see and work on.
During runtime it is not visible. However
The common dialog box control made our life easier
by giving us a simple and easy way to provide the
necessary interface to the user. We were able to create a
small application that would allow the user to create a
new file or open an existing file, add text to it, save the
changes and print the contents of the file as well.
The tree view control is a very interesting control to work
with. With this control you can display the data as a hierarchy.
The windows explorer is built around a tree view control. It
displays the drives, directories, subdirectories and files in the form
of a hierarchy. You can use the same control to display the data
from a database. For example, you can display the list of
customers, the invoice no and date for each customer, and for each
invoice the items therein and so forth.
Working with the tree view control:
Draw a Tree View control on your form. Add the following code to the
form load event.
Private Sub Form_Load()
Dim NewNode As Node
Set NewNode = TreeView1.Nodes.Add(, , ”c”, ”customer”)
Set NewNode = TreeView1.Nodes.Add(“c” , tvwchild , “child1”,
“Customer_Code”)
Set NewNode = TreeView1.Nodes.Add(“c” , tvwchild , “child2”,
“Customer_Name”)
Set NewNode = TreeView1.Nodes.Add(“c” , tvwchild , “child3”,
“Customer_City”)
End Sub
Visual basic programming
What is database?
A database can be defined as a collection of records stored in
tables. It has a set of rules and tools to manage these records.
There are different type of data bases, each with it’s own format.
the most commonly known data base type are:
 Relational database
 Network model
 Hierarchical model
user 1’s view user 2’s view
Supplier Name
Address
Amount Due
Supplier Name
Address
Physical view
 The database grid control display fields from a record set
object as a series of rows and columns, and enables
manipulation of this data.
 The data aware DBgrid control is like an enhanced grid
control. Once the properties are set, gets populated
automatically with the data from the record set object.
 You only need to fix the number of columns. The total
number of rows is indeterminate. A DB Grid control can
have as many rows as the system resources can support
and about 1700 columns.
 Lets us see the DB Grid in action:
start a new project.
On the form add the following control
 One data control
 One DB grid control
 If you don't have the DB grid control, as part of your tool
box, right click on the tool box. Select components from
the were pop-up menu. From the list displayed there after,
click on DB grid control. click on OK you have it on your
toolbox.
 Set the properties for the controls as follows
Data control
Data base sources: C:/VB/Bibli.mdb
Records sources: Publishers
DB Grid control
data sources: data1
 To open a data base, we have to use the open database
method. This method opens a specified database in a
workspace object and return a reference to the data base
object that represents it.
 Syntax:
Set database = workspace.OpenDatabase (dbname,options,read-
only,connect)
The OpenDatabase method syntax has three parts.
 Databsae
 Workspace
 Dbname
 Options
 Read-only
 Connect
Visual basic programming

More Related Content

What's hot (20)

PPTX
Ms access 2007
Ramesh Pant
 
PPSX
UNIDAD V: Visual Basic
rei morales
 
PPT
MS Access – Part 1 (One Day Workshop)
Khader Shaik
 
PPTX
Tutorial for using SQL in Microsoft Access
mcclellm
 
PPT
Introduction to microsoft access
Hardik Patel
 
ODP
XPages - The Ties That Bind
Michael McGarel
 
PPT
VB6 Using ADO Data Control
Notre Dame of Midsayap College
 
PPT
MS Access Training
Michael Sheyahshe
 
PPT
Binding to multiple datasources on a single xPage
dominion
 
PPTX
SAP HANA - Attribute views
Yasmin Ashraf
 
PPTX
MS Access teaching powerpoint tasks
skomadina
 
PPTX
Ms access
Neetu Yadav
 
PDF
Understanding dso (data store object) part 1%3a standard dso.doc
pran1
 
PPTX
CIS 2303 LO3 Process Modeling
Ahmad Ammari
 
PPTX
Access Basics 01
Lets try
 
PPTX
Ms access ppt 2017 by Gopal saha
253253
 
PPTX
Dfd examples
patel chirantan
 
PPTX
SAP BW - Creation of hierarchies (time dependant hierachy structures)
Yasmin Ashraf
 
PPT
Data flow diagram
Upendra Sengar
 
PPTX
Sql database terms
Joe Robles
 
Ms access 2007
Ramesh Pant
 
UNIDAD V: Visual Basic
rei morales
 
MS Access – Part 1 (One Day Workshop)
Khader Shaik
 
Tutorial for using SQL in Microsoft Access
mcclellm
 
Introduction to microsoft access
Hardik Patel
 
XPages - The Ties That Bind
Michael McGarel
 
VB6 Using ADO Data Control
Notre Dame of Midsayap College
 
MS Access Training
Michael Sheyahshe
 
Binding to multiple datasources on a single xPage
dominion
 
SAP HANA - Attribute views
Yasmin Ashraf
 
MS Access teaching powerpoint tasks
skomadina
 
Ms access
Neetu Yadav
 
Understanding dso (data store object) part 1%3a standard dso.doc
pran1
 
CIS 2303 LO3 Process Modeling
Ahmad Ammari
 
Access Basics 01
Lets try
 
Ms access ppt 2017 by Gopal saha
253253
 
Dfd examples
patel chirantan
 
SAP BW - Creation of hierarchies (time dependant hierachy structures)
Yasmin Ashraf
 
Data flow diagram
Upendra Sengar
 
Sql database terms
Joe Robles
 

Similar to Visual basic programming (20)

PPTX
dbms ms access basics and introduction to ms access
ssuserb9efd7
 
PPTX
Introduction to database with ms access.hetvii
07HetviBhagat
 
PPTX
Introduction to database with ms access(DBMS)
07HetviBhagat
 
PDF
Accounting Information Systems 8th Edition Hall Solutions Manual
maelenkutnik
 
PDF
Accounting Information Systems 8th Edition Hall Solutions Manual
softaelyseu26
 
PPTX
Ms access 2010
Alsufaacademy
 
PPTX
Database fundamentals
Then Murugeshwari
 
DOCX
Android interface elements and controls-chapter8
Dr. Ramkumar Lakshminarayanan
 
DOCX
Access Assignments Complete List1. Acc 2 Bank Database2. Acc.docx
annetnash8266
 
PDF
Accounting Information Systems 8th Edition Hall Solutions Manual 2024 scribd ...
byagerfauser
 
DOCX
Online library management system
Yesu Raj
 
DOCX
Grid view control
Paneliya Prince
 
PDF
Accounting Information Systems 8th Edition Hall Solutions Manual
ksyshahyroad
 
PDF
Notes windows form controls gui applications
William Olivier
 
PPT
MS Access and Database Fundamentals
Ananda Gupta
 
PPT
Vb basics
sagaroceanic11
 
DOCX
data binding.docx
kishorebabu123
 
PPT
Getting Started Guide
guest5d007d
 
PPT
nithin raj ppt.ppt
NithinRaj247269
 
dbms ms access basics and introduction to ms access
ssuserb9efd7
 
Introduction to database with ms access.hetvii
07HetviBhagat
 
Introduction to database with ms access(DBMS)
07HetviBhagat
 
Accounting Information Systems 8th Edition Hall Solutions Manual
maelenkutnik
 
Accounting Information Systems 8th Edition Hall Solutions Manual
softaelyseu26
 
Ms access 2010
Alsufaacademy
 
Database fundamentals
Then Murugeshwari
 
Android interface elements and controls-chapter8
Dr. Ramkumar Lakshminarayanan
 
Access Assignments Complete List1. Acc 2 Bank Database2. Acc.docx
annetnash8266
 
Accounting Information Systems 8th Edition Hall Solutions Manual 2024 scribd ...
byagerfauser
 
Online library management system
Yesu Raj
 
Grid view control
Paneliya Prince
 
Accounting Information Systems 8th Edition Hall Solutions Manual
ksyshahyroad
 
Notes windows form controls gui applications
William Olivier
 
MS Access and Database Fundamentals
Ananda Gupta
 
Vb basics
sagaroceanic11
 
data binding.docx
kishorebabu123
 
Getting Started Guide
guest5d007d
 
nithin raj ppt.ppt
NithinRaj247269
 
Ad

Recently uploaded (20)

PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PPTX
Difference between write and update in odoo 18
Celine George
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
Horarios de distribución de agua en julio
pegazohn1978
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Difference between write and update in odoo 18
Celine George
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
epi editorial commitee meeting presentation
MIPLM
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Ad

Visual basic programming

  • 3. Text box: In order to display or accept user input in the form of text like name, customer ID, ETC., Visual basic provides you with this controls. It is used to display text and allows the user to edit the data in the box. A text box control is also called an edit field or edit control. It displays the information entered at design time, entered by the user, or assigned to the control in code at run time. Command button: Creates a button that the user can choose to carry out a command. The user will click on this button and the computer will perform the task associated with the button. Activity does not stop with the invoice that you have generated. A copy may have to be sent to the commercial tax department, the credit card company, the head office, and so on.
  • 4. Label box: It allows you to display text that you don’t want the user to change, such as a caption under a graphic. When you want to print the voices, you need to know if the customer is going to pay by cash or toque, or credit card. This means that the billing clerk has to select one from the various options available. For this Visual basic has the option button control. Check box: Creates a box that the user can easily choose to indicate if something is true or false, or to display multiple choices when the user can choose more than one. There are many more controls that Visual basic provides that may not be used in the immediate context. Let us take a look at the other controls that are part of the standard set of controls available on the toolbox.
  • 5. Combo box: The user can either choose an item from the list or enter a value in the text box. The new value entered can be added to the existing data. The list box and the combo box display data usually from a database. In order to access data and to manipulate data in a database like access, SQL server, etc. Visual basic provides a control called the data control. Image control: This is very similar to the pictures box control. Images displayed in an image control can only be decorative and use fewer resources than a pictures box.
  • 7.  Moving from one drive to another : The DriveListBox  Moving from one directory to another : DirListBox  List file(s) in a dictionary : FileListBox
  • 8.  The DriveListBox control: This is a drop-down list box that will display the list of drives on your computer. It gets all information from the operating system and allows the user to select a drive of the choice. Selecting a particular drive records a change in the Drive property of the DriveListBox.  The DirListBox control: A drop-down list box that displays a hierarchical list of directories in the current drive.  The FileListBox: Displays all files in the current Directory or Folder. Allows users to set up search criteria for files. These three controls used together can create an elegant interface that will allow the user to locate a file on his computer without any sweat.
  • 9. Add the Common Dialog control to your toolbox by Right clicking on the toolbox and selecting ‘Components’ from the pop-up menu. Next select ‘Microsoft common dialog control 6.0 from the list of components. You will see this as a control on your toolbox. Draw it on your form. Please note that this control does not have an interface that the user will see and work on. During runtime it is not visible. However
  • 10. The common dialog box control made our life easier by giving us a simple and easy way to provide the necessary interface to the user. We were able to create a small application that would allow the user to create a new file or open an existing file, add text to it, save the changes and print the contents of the file as well.
  • 11. The tree view control is a very interesting control to work with. With this control you can display the data as a hierarchy. The windows explorer is built around a tree view control. It displays the drives, directories, subdirectories and files in the form of a hierarchy. You can use the same control to display the data from a database. For example, you can display the list of customers, the invoice no and date for each customer, and for each invoice the items therein and so forth.
  • 12. Working with the tree view control: Draw a Tree View control on your form. Add the following code to the form load event. Private Sub Form_Load() Dim NewNode As Node Set NewNode = TreeView1.Nodes.Add(, , ”c”, ”customer”) Set NewNode = TreeView1.Nodes.Add(“c” , tvwchild , “child1”, “Customer_Code”) Set NewNode = TreeView1.Nodes.Add(“c” , tvwchild , “child2”, “Customer_Name”) Set NewNode = TreeView1.Nodes.Add(“c” , tvwchild , “child3”, “Customer_City”) End Sub
  • 14. What is database? A database can be defined as a collection of records stored in tables. It has a set of rules and tools to manage these records. There are different type of data bases, each with it’s own format. the most commonly known data base type are:  Relational database  Network model  Hierarchical model
  • 15. user 1’s view user 2’s view Supplier Name Address Amount Due Supplier Name Address Physical view
  • 16.  The database grid control display fields from a record set object as a series of rows and columns, and enables manipulation of this data.  The data aware DBgrid control is like an enhanced grid control. Once the properties are set, gets populated automatically with the data from the record set object.  You only need to fix the number of columns. The total number of rows is indeterminate. A DB Grid control can have as many rows as the system resources can support and about 1700 columns.  Lets us see the DB Grid in action: start a new project. On the form add the following control  One data control  One DB grid control
  • 17.  If you don't have the DB grid control, as part of your tool box, right click on the tool box. Select components from the were pop-up menu. From the list displayed there after, click on DB grid control. click on OK you have it on your toolbox.  Set the properties for the controls as follows Data control Data base sources: C:/VB/Bibli.mdb Records sources: Publishers DB Grid control data sources: data1
  • 18.  To open a data base, we have to use the open database method. This method opens a specified database in a workspace object and return a reference to the data base object that represents it.  Syntax: Set database = workspace.OpenDatabase (dbname,options,read- only,connect) The OpenDatabase method syntax has three parts.  Databsae  Workspace  Dbname  Options  Read-only  Connect