How To Use
ActiveX
ActiveX can be supported by
many development platforms. Following lists main development
platforms:
Microsoft Visual Basic 4.0
Microsoft Visual Basic 5.0 & 6.0
Microsoft Visual Foxpro 3.0 and 5.0
Microsoft Visual Basic for Application (Word, Excel and
PowerPoint)
Microsoft
Access
Microsoft Visual C++ 4.x
Microsoft Visual C++ 5.0 & 6.0
Microsoft Visual Studio.NET
Microsoft Visual Basic 4.0
Start your Visual Basic 4,0 and load your project
or create a new project.
- Choose menu Tools|Custom Controls... or press
Ctrl+T or right-click the Toolbox and choose Custom Controls... in the popup
menu.
- In the Custom Controls dialog, find which
control you want to use in your project from the Available Controls
list.
- Set the check box before the controls you want
then click the OK in the Custom Controls dialog.
- The icons of the controls you choose are showed
at the end of the Toolbox. Click the icon to choose a control and insert the
control into the form.
Microsoft Visual Basic 5.0 & 6.0
Start your Visual Basic 5.0 or 6.0 and load your
project or create a new project.
- Choose menu Project|Components... or press
Ctrl+T or right-click the Toolbox and choose Components... in the popup
menu.
- In the Components dialog, select Controls tab,
find which control you want to use in your project from the controls
list.
- Set the check box before the controls you want
then click the OK in the Components dialog.
- The icons of the controls you choose are showed
at the end of the Toolbox. Click the icon to choose a control and insert the
control into the form.
Microsoft Visual Foxpro 3.0 and
5.0
Start your Visual Foxpro
- Choose menu Tools|Options...
- In the Options dialog, select Controls tab and
select the OLE Controls radio button and the Controls check box.
- Find which control you want to use in your
project from the controls list.
- Set the check box before the controls you want
then click OK in the Options dialog.
- Start the form Designer by loading the existing
form or creating a new form.
- Click insert OLE controls button on the Form
Controls toolbar and choose OLE Controls from the popup menu.
- The icons of the controls you choose are showed
on the Form Controls toolbar. Click the icon to choose a control and insert
the control into the form.
Microsoft Visual Basic for Application
(Word, Excel and PowerPoint)
Start your Office application and load a document
or create a new document.
- Choose menu Tools|Macro|Visual Basic Editor or
press ALT-F11.
- The Microsoft Visual Basic for Application
design interface appears.
- Choose a existing Form or create a new form.
Choose menu Tools|Additional Controls... or right-click the Toolbox and
choose Additional Controls... from the popup menu.
- Find which control you want to use in your
project from the Available Controls list.
- Set the check box before the controls you want
then click OK in the Additional Controls dialog.
- The icons of the controls you choose are showed
on the Toolbox. Click the icon to choose a control and insert the control
into the form.
Microsoft Access
Start your Microsoft Access and load a existing
database or create a new database.
- In the Database windows, choose Forms tab.
- Click New to create a Form or click Design to
design a existing form.
- In the Toolbox, click insert OLE controls
button. All controls currently installed on your computer will showed in a
popup menu.
- Choose a control you want to use in your form by
clicking the name of the control in the popup menu.
- Insert the control into your form.
Microsoft Visual C++ 4.x
Start your Visual C++ 4.x.
If you only use the OCX in the dialog box
- Click the ResourceView tab to choose the
resource edit.
- Double-click the dialog's name to edit the
dialog.
- Right-click the dialog and choose Insert OLE
Control... from the pop-up menu.
- Choose the Control from the OLE control list and
click OK.
- Then insert the control into the dialog.
If you want to use the OCX in your project
- Load the project.
- Choose menu Insert|Component...
- Choose the OLE Controls tab.
- Choose the Meter Control and click
Insert.
- Visual C++ will generate several classes of the
control,such as CMeter.
- Then you can define variable of the type as
CMeter.
Microsoft Visual C++ 5.0 & 6.0
Start your Visual C++ 5.0.
If you only use the OCX in the dialog box
- Click the ResourceView tab to choose the
resource edit.
- Double-click the dialog's name to edit the
dialog.
- Right-click the dialog and choose Insert ActiveX
Control... from the pop-up menu.
- Choose the Control from the ActiveX control list
and click OK.
- Then insert the control into the dialog.
If you want to use the OCX in your project
- Load the project.
- Choose menu Project|Add To Project|Components
and Controls...
- Open the Registered ActiveX Control
gallery.
- Choose the Control and click Insert.
- Visual C++ will generate several classes of the
control,such as CCounter.
- Then you can define variable of the type as
CCounter.
Microsoft Visual Studio.NET
You can also put ActiveX controls on Windows Forms (VB.NET, C# or other
.NET language). Before you can add ActiveX controls to your forms, you must add them
to the ToolBox. You can open the Customize Toolbox dialog box from the Tools
menu or by right click ToolBox to open it (Choose Windows Forms
Tab | Right click the tab and choose "Customize Toolbox..." for
VS.Net 2002 or "Add/Remove
Items..." for VS.Net 2003, or Click "Choose ToolBox Items" in Tool Menu (Choose "Choose Items" if using Right-Click ToolBox
) for VS2005 ) .
To add an ActiveX control to your Windows Form
- Add the ActiveX Control to ToolBox.
- Double-click the control on ToolBox
- Resize and position the control in the Windows Form.
- Configure properties and write codes to implement your own functions.