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:
c: 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.
Martin Allen 1999 - 2011. Last updated Wednesday 10 August 2011 07:16:15 PM +0100.