Preparing to Use ActiveX Controls

Setting Initial Properties

The initial property values you set for an ActiveX control define how the control displays when the Web browser loads the HTML page.

To set initial object properties for an ActiveX control, use <PARAM> tags.

Syntax

The <PARAM> tag uses the following syntax:
 <PARAM NAME="ParameterName" VALUE="Value"> 

For each property, use a separate <PARAM> tag.

Example

This example shows the <OBJECT> tag for the ActiveX Label control. The control has initial property values set for Angle, Alignment, and Caption:
 <OBJECT classid="clsid:99B42120-6EC7-11CF-A6C7-00AA00A47DD2" id=lblActiveLbl width=250 height=250 > <PARAM NAME="Angle" VALUE="90"> <PARAM NAME="Alignment" VALUE="2"> <PARAM NAME="Caption" VALUE="Hello, World!"> </OBJECT> 

Note

To determine the property names and values supported by an object, see the Help file for the object, or use the Object Browser in Microsoft Visual Basic 4.0 or later.


* To browse a Form object with the Object Browser

  1. Start Visual Basic.
  2. Create a new Standard EXE project.
  3. Press F2 to open the Object Browser.
  4. In the Project/Library drop-down list, select Project1 .
  5. In the Classes list, click Form1 .
  6. Under Member of Form1 , scroll through the list of properties, methods , and other objects available to the Form1 object.

    As you add controls to Form1 , each object will then be added to the list of members of Form1.

  7. Close Visual Basic.

Lesson Summary

An ActiveX control is a binary file in an executable format. ActiveX controls offer increased functionality, increased performance, and code privacy. The <OJBECT> tag is used to insert ActiveX controls into HTML documents. <OBJECT> tags use attributes such as CLASSID, ID, and CODEBASE to define the control. The initial properties you set for an ActiveX control determine how it displays when it loads into an HTML page.


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