Creating an ActiveX Control

Testing the ActiveX Control

In this exercise, you will test the ActiveX control you created in the previous exercise by adding the control to a Web page using Microsoft FrontPage.

* To open a FrontPage Web Site

  1. From the Windows Start menu, point to Programs and click Microsoft FrontPage .
  2. Click More Webs to open the Open FrontPage Web dialog box.
  3. In the Select a Web Server or disk location name box, enter localhost and click List Webs .
  4. Select <Root Web> and click OK .
* To implement the ActiveX control
  1. Double-click My Home Page to open the FrontPage Editor.
  2. In the FrontPage editor, place the insertion point at the end of the page.
  3. Type This is an ActiveX control:
  4. From the Insert menu, point to Advanced , then click ActiveX Control .
  5. Under the Pick A Control drop-down list box, select Lab8.ChangeDateTime , then click OK .
  6. From the toolbar, click Preview In Browser .
  7. Close Internet Explorer.
  8. Close Microsoft FrontPage.

ActiveX Controls in Microsoft Visual Basic

ActiveX controls are added to the Visual Basic toolbox to supplement its intrinsic controls, such as the command button. When added to a Visual Basic project, an ActiveX control becomes part of the development and run-time environment, and provides new functionality to an application.

Microsoft Visual Basic automatically installs and registers ActiveX controls in the \Windows\System or System32 directory. The controls can then be used to build applications.

* To add an ActiveX control to Visual Basic

  1. Start Microsoft Visual Basic and create a new Standard EXE project.
  2. Right-click on the Toolbox and choose Components.
  3. Select Calendar Control 8.0 .
  4. Click OK.

    The Microsoft Calendar control is now added to the Toolbox.

  5. Add a new Calendar control to Form1 .
  6. Press the F5 key to run the program in Microsoft Visual Basic.
  7. The Microsoft Calendar control can be used within the form.
  8. Stop the application and close Microsoft Visual Basic.

ActiveX Controls in Microsoft Office

Microsoft Office applications contain a Control Toolbox composed of ActiveX controls. For example, the following ActiveX controls are used in Office: command buttons, option buttons , dialog boxes, and forms.

The Office suite allows you to create forms similar to those in Visual Basic. For example, Microsoft Word can be used to design a form and set the properties for the form elements. Sample forms, such as feedback and survey forms, are available from the Web Page Wizard. The wizard can be used to create a basic form and then customize it by inserting the desired controls.



Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net