When creating a new class you have a number of options:
1) Create a new ActiveX Control project, and add controls to that. This will then be compiled into a OCX, which can then be used by multiple projects.
2) Just add a new control to your current EXE project. This will be included into your EXE, and cannot be used by other projects.
To create a new ActiveX Control project:
1) Select File|Add Project, and double click on ActiveX Control. A new project is added to your project group.
2) A control is automatically added to the ActiveX control project for you.
3) Give the project a suitable name
To add a new class to your current EXE project:
1) Select Project|Add User Control, and double click on User Control.
2) A new control is added to your project.
Then give the class a good name that means something:
f123x -
not a good name. What's it for? Is it a class, control,
form or a module?
Project
- getting there. This control displays a project. Is it
a class, control, form or a module?
ctlProject
- good! This is a control (ctl) that displays a project,
and will have methods and properties to allow you to use it.
A new icon on the toolbox has been added. Select your EXE project and add the control to a form. If the new icon is disabled, close both the form window and the code window of your Control. When you switch back to the EXE project, the icon will have been enabled.
Comments