VB Part 1
VB Part 1
VB Part 1
4. What is IDE? What are the types of applications that can be created in VB
Visual Basic is an Integrated Development Environment (IDE). The most important
applications that can be developed in Visual Basic are:
Standard EXE:Standard EXE application is common to all versions of Visual Basic.
ActiveX EXE, ActiveXDLL:Both are code building components which do not have a visible
interface, they exhibit identical functions but both are packaged into different Dynamic Link
Libraries or executable files.
ActiveX Control:This application is used to build own custom controls also called OCX file.
VB Application Wizard:VB Application Wizard project is used to provide a new skeleton for
an application (similar to word processor template).
Data Project:Data Project is like Standard EXE project but it adds those controls which are
used in accessing database.
Add-in:Add-in is used for the creation of special type of commands in Visual Basic IDE. E.g.
Visual Data Manager.
Form Properties:
Form Events:
· Form Methods:
Cls Clears all graphics and text from form. Does not clear
any objects.
Print Prints text string on the form.
Examples
The command button is probably the most widely used control. It is used to begin,
interrupt, or end a particular process.
7. What is MDI? What are the advantages of MDI forms and its features?
The Multiple Document Interface (MDI) was designed to simplify the exchange of
information among documents; you can maintain multiple open windows.
The main Form, or MDI Form, isn't duplicated, but it acts as a container for all the windows, and it
is called the parent window. The windows in which the individual documents are displayed are
called Child windows. At run time, an MDI form and all of its child forms take on special
characteristics:
• All child forms are displayed within the MDI form's workspace. The user can move and
size child forms like any other form; however, they are restricted to this workspace.
• By setting the AutoShowChildren property, you can display child forms automatically when
forms are loaded (True), or load child forms as hidden (False).
Advantages of MDI
MDI applications can often handle multiple documents more readily than SDI
programs.
For example, many MDI text editors allow the user to open multiple text files side by
side in the same window.
It easy to compare and look up information from a second document while working on
the first.
MDI applications tend to perform more quickly than SDI programs
SDI MDI
(i) It stands for single Document Interface. (i) It stands for Multiple Document Interface.
(ii) There is no concept of parent window
rather every window is independent of each (ii) In MDI all the windows are a part of a larger
other. parent window
(iii) It act as an container for other controls or (iii) It acts as an container for other windows or
objects forms.
(iv) It has MDI-child property which is used to
(iv) No such type of property is available setup a window as child.
(v) The windows can be moved around only with
(v) All the windows can be moved freely the parent window.
(i) It stands for Multiple Document Interface.
(i) It stands for single Document Interface. (ii) In MDI all the windows are a part of a larger
(ii) There is no concept of parent window parent
8. Write short notes on the following – a) Activex Data Objects (ADO), b) Procedures and its
types and c) Control Array
c) Control Array:
Array of controls having same type & same name which share common properties is known
as control array. They also share the same event procedures. Since controls have the same name
VB needs a way to distinguish them. This is done by a property called index. This index property
identifies the specific control & gives the flexibility to organize them at runtime. Control Array can
be created either in design time or in runtime.
Elements of the same control array have their own property settings.
Common uses for control arrays included menu controls and option button groupings.
If you want to create a new instance of a control at run time, the control must be a member
of a control array
Using the control array mechanisms, each new control inherits the common event procedures already
written for the array.
Types of Drivers
ODBC defines two types of drivers:-
Single-tier - The driver processes both ODBC calls and SQL statements.
Multiple-tier - The driver processes ODBC calls and passes SQL statements to the data source.
A module level variable can be accessible either within a module or used by all other modules.
Variables used within a module are declared or private and the variable used by all other modules is
declared as public.
There are three types of modules in VB:-
Form module, Standard modules, Class modules
The class module contains the defining characteristics of a class, including its properties and
methods.
The form module contains the graphic elements of the VB application along with the instruction.
The general module generally contains general-purpose instructions not pertaining to anything
graphic on-screen.
Document
Document is the class to manage data part of the objects. Application often derives a class from
CDocument. This deals with saving and retrieving data fields to and from the file stream.
View
View is the class module to display data of the document. A derived class of CView is often used for
this purpose. This display part can be the display of the document in graphical form or with UI
elements or in the form of printable view which contains formatted text.
Frame
MFC framework uses a Frame window or class CFrame to display window in the screen and thus a
CFrame class is always needed in any application which follows document view architecture.
13. Explain Input Box and Message Box functions.
Input Box :
Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns a String
containing the contents of the text box.
Syntax :
memory_variable is a variant data type but typically it is declared as string, which accept the message
input by the users.
Prompt - String expression displayed as the message in the dialog box. If prompt consists of
more than one line, you can separate the lines using the vbCrLf constant
Title - String expression displayed in the title bar of the dialog box. If you omit the title, the
application name is displayed in the title bar
default-text - The default text that appears in the input field where users can use it as his
intended input or he may change to the message he wish to key in.
x-position and y-position - the position or the coordinate of the input box
Message Box:
Displays a message in a dialog box and wait for the user to click a button, and returns an integer
indicating which button the user clicked.
Syntax :
Icons
Constant Value Description
vbCritical 16 Display Critical message icon
vbQuestion 32 Display Warning Query icon
vbExclamation 48 Display Warning message icon
vbInformation 64 Display information icon
Buttons
14. What do you mean by Connection String and Record Source in ADO data control?
Common Dialog box:- A Common Dialog Box is a window used to display and for accept
information.
Dialog Boxes can either be modal or modeless.
• A Modal Dialog Box does not let the user continue working with rest of the
application until it is closed.
• A Modeless Dialog Box, on the other hand lets the user shift the focus between the
dialog box and another form without having to close the dialog box