© 1996 by Steven Holzner. All rights reserved.

3-D Option Buttons

Buy this book

3-D option buttons look much like regular option buttons. We add a 3-D option button to our ActiveX overview page like this, giving it the ID Option1:

  <HTML>
    <HEAD>
    <TITLE>OCX Control Page</TITLE>
    </HEAD>
    <BODY LANGUAGE = VBScript ONLOAD = "Page_Initialize">
    <CENTER>
    <H1>OCX Control Page</H1>
    </CENTER>
        .
        .
        .
    <!- 3D Option Button>
    <PRE>
--> 3D Option:  <OBJECT CLASSID="clsid:0BA686BE-F7D3-101A-993E-0000C0EF6F5E"
                HEIGHT=50 WIDTH=50 ID=Option1></OBJECT>
    </PRE>
        .
        .
        .
    <SCRIPT LANGUAGE = VBScript>
            Sub Page_Initialize
                  Cmd1.Caption = "Hello"
                  Frame1.Caption = "Frame"
                  Panel1.Caption = "Panel"
                  Grid1.Rows = 3
                  Grid1.Cols = 3
                  Grid1.Row = 1
                  Grid1.Col = 1
                  Grid1.Text = "5"
                  Graph1.GraphData = 2
                  Graph1.GraphData = 4
                  Graph1.GraphData = 5
                  Graph1.GraphData = 3
            End Sub
    </SCRIPT>
    </BODY>
    </HTML>

This new option button appears in Figure 6.4. Like other buttons, it has a click event. A value of true is passed to this subroutine if the option button is selected, and false if it's unselected. (When it's unselected, there is no dot in the center of the option button.) In this way, 3-D option buttons function much as the option buttons we've already worked with. Let's turn now to another useful ActiveX control: sliders.

© 1996 by Steven Holzner. All rights reserved