View contents of this chapter

Implementing the ActiveX Control

You can insert your new control into an application and place it on the form window just as you insert other controls. You must compile the ActiveX control before you can insert the control into an application. When you compile the ActiveX control VB generates an .OCX file.

Play Sound If you don't create the OCX file, you cannot use the control in an application.

To compile the ActiveX control, select File, Make. You can select the location of the compiled ActiveX control.

Now we will test our new control by dropping the control into a new project. Select File, new project and create a new Standard EXE file. Press Ctrl + T to open the Components dialog box.

Press the browse button and locate the file name Time.ocx. Select the ActiveX control and close the diloag box. The control will appear in the toolbox. Place the control on your form. Run the application, you will see the following:


Play Sound

Today you learned how to work with special ActiveX objects. Not only ActiveX controls add new controls to your toolbox, but they can also be used with other applications, such as Internet browsers. Moreover, the chapter explained how to create your own ActiveX controls.

 



© Universal Teacher Publications        INDEX Previous Screen Next Screen