TechnologyUK - Programming (VB6) Logo

Controls

Controls that are built in to VB are called intrinsic controls, and are available to all VB programs. All of the intrinsic controls appear in the Toolbox. ActiveX Controls are controls that exist as separate files with the extension .OCX. Before you can use an ActiveX control, it must be registered in the Windows Registry. If you have a control which has not been registered by other software, you can register it using a program called REGSVR32, which comes with all version of Windows. To use it, simply type in: REGSVR32 control.ocx, where control.ocx is the filename of the control to be registered. Most VB projects will use a number of intrinsic controls, together with a (usually smaller) number of ActiveX controls that provide specific functionality not provided by the intrinsic controls.

Intrinsic Controls

Visual Basic comes with 20 built-in controls (excluding the pointer), which are summarised below. Some controls are used on virtually every application. Others are only used when a specific need arises. Several of these controls can display or edit data from a database. The intrinsic controls provided with all version of Visual Basic are shown below.

Visual Basic Intrinsic Controls
Pointer Pointer Picture PictureBox Label Label
TextBox TextBox Frame Frame CommandButton CommandButton
CheckBox CheckBox OptionButton OptionButton ComboBox ComboBox
ListBox ListBox HScrollBar HScrollBar VScrollBar VScrollBar
Timer Timer DriveListBox DriveListBox DirListBox DirListBox
FileListBox FileListBox Shape Shape Line Line
Image Image Data Data OLE OLE

ActiveX Controls

The Professional Edition of Visual Basic provides a number of ActiveX controls, none of which are normally shown in the Toolbox. You can insert ActiveX controls into the Toolbox as you require them (right-click on the toolbox, select Components , check the controls to include, and press OK ). The ActiveX controls are illustrated below.

Visual Basic ActiveX Controls
SSTab SSTab MSFlexGrid MSFlexGrid CommonDialog CommonDialog
TabStrip TabStrip ToolBar ToolBar StatusBar StatusBar
ProgressBar ProgressBar TreeView TreeView ListView ListView
ImageList ImageList Slider Slider ImageCombo ImageCombo
Animation Animation UpDown UpDown MonthView MonthView
DTPicker DTPicker FlatScrollBar FlatScrollBar Inet Inet
RichTextBox RichTextBox MSChart MSChart WinSock WinSock
MAPISession MAPISession MAPIMessages MAPIMessages MMControl MMControl
PictureClip PictureClip SysInfo SysInfo MSComm MSComm
MaskEdBox MaskEdBox DataGrid DataGrid DataList DataList
DataCombo DataCombo CoolBar CoolBar Adodc Adodc
MSHFlexGrid MSHFlexGrid