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
  1. From the Project menu, choose Components.
  2. 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
  1. 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.
  2. 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.