Visual Basic Controls ppt

16
VISUAL BASIC CONTROLS Submitted by: RANJUMA SHUBHANGI S.MAMTA RUCHI YADAV Submitted to: PROF. VANI AGARWAL

Transcript of Visual Basic Controls ppt

Page 1: Visual Basic Controls ppt

VISUAL BASIC CONTROLS

Submitted by:

RANJUMA SHUBHANGI

S.MAMTA

RUCHI YADAV

Submitted to:

PROF. VANI AGARWAL

Page 2: Visual Basic Controls ppt

PRESENTATION OUTLINES

INTRINSIC

CONTROLS

ACTIVEX CONTROLS

COMMON DIALOG

CONTROLS

Page 3: Visual Basic Controls ppt

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 .

Page 4: Visual Basic Controls ppt

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 .

Page 5: Visual Basic Controls ppt

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.

Page 6: Visual Basic Controls ppt

STANDARD ACTIVEX CONTROLSThe 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.

Page 7: Visual Basic Controls ppt

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.

Page 8: Visual Basic Controls ppt

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.

Page 9: Visual Basic Controls ppt

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.

Page 10: Visual Basic Controls ppt

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.

Page 11: Visual Basic Controls ppt

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.

Page 12: Visual Basic Controls ppt

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.

Page 13: Visual Basic Controls ppt

The common dialog control allows you to display these

commonly used dialog boxes:

Open

Save As

Color

Font

Print

Help

Page 14: Visual Basic Controls ppt

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.

Page 15: Visual Basic Controls ppt

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 Invokes Windows help engine

Page 16: Visual Basic Controls ppt