Visual Basic Concepts

Manually Deploying ActiveX Controls

You perform these steps to manually deploy ActiveX controls on an HTML page:

  1. Create an HTML page the users can access to download your control.

  2. On the HTML page, use the OBJECT tag to provide a means for the browser to download, register, and reference the ActiveX control. The object tag includes the control's class ID, an ID attribute used to reference the control, the CODEBASE tag, and parameters to set properties. The following shows an example of the HTML you might use:
    <OBJECT 
        classid="clsid:2F390484-1C7D-11D0-8908-00A0C90395F4" 
        codebase="http://www.mycompany-inc-10.com/controls/label.ocx
       #version=1,0,0,0" 
        id="Catalog" 
        width="150" 
        height="20" 
        align="center" 
        vspace="0"
    > 
        <PARAM NAME="Caption" value="Our Catalog"> 
        <PARAM NAME="FontName" value="News Gothic MT"> 
        <PARAM NAME="FontSize" value="11"> 
        <PARAM NAME="FontBold" value="1"> 
        <PARAM NAME="ForeColor" value="000000"> 
    </OBJECT>
    
  3. Use VBScript to handle click events so that clicking each control will load a specific .htm file in a specific HTML frame. The following code shows an example:
    <SCRIPT LANGUAGE="VBScript"> 
    Sub Welcome_Click 
    Parent.Parent.Frames(1).Location.Href="Welcome.htm"
    Welcome.ForeColor = 000000
    End Sub 
    </SCRIPT>