ActiveX Controls - Introduction



Read and add posts to the Visual Basic 6.0 Forums

Download some of my programs and OCXs

Read the Tips here

The old style forum is still available here



ActiveX Control

Welcome to the ActiveX Controls section of the site.  This section will explain how to use some common ActiveX controls and ones that I have made myself.

ActiveX is the name Microsoft has given to COM components.  They are usually have the .ocx extension, but can also have the .dll and .exe extensions.  To add ActiveX controls to your project, click on the Project then Components or press Ctrl+T on your keyboard.  The following screen will appear:


Put a check against any ActiveX control that you want to load or if the one that you are looking for is not there, then click the Browse button.

If you are using Windows Vista, you will need to register any controls that you add yourself before they can be loaded into Visual Basic.  To do this, locate the Command Prompt on your Start Menu:

Click on the Selected Items Only checkbox to list only the controls that you have checked.  When you click on OK, the control will appear on the toolbox ready for placing on the form:

On the window that appears, click on Continue.  Navigate to the system32 folder (where you would have copied the control into) and then register the control by typing:

cd c:\windows\system32
regsrv32 filename.ocx

Substitute filename.ocx with the filename of the control you want to register.  It should now be possible to add this control to your Visual Basic programs.

Once you have placed it on the form, you can treat it like any other control i.e. it will have its own properties, methods and events.  Click on your browser's back button and look at how some of these components are used.

Archived Comments

From: amit k pramanick
Date: Sunday, June 8, 2003 at 20:03:27
Comments: hi there,
when i include mschart into my programme and make it executable, I can't run it on a computer that does not have VB6 installed. do i have to do something extra?


Reply: The computer you are trying to run the program on should have the Visual Basic 6.0 runtime files installed.

You also need to put the MSChart .ocx file and any other .ocx and .dll files your program uses into the Windows System folder.

From: Luigi
Date: Friday, November 8, 2002 at 17:00:54
Comments: With the comctl32.ocx i have found the error 713, i don't know this error.
Please answe

Martin Allen 1999 - 2011.  Last updated Wednesday 10 August 2011 07:16:15 PM +0100.