PageRenderTime 15ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/HTMLEmbedActiveX/CSActiveX.html

#
HTML | 54 lines | 51 code | 3 blank | 0 comment | 0 complexity | 7cb64eba5c02091bf1ec15169ccbe95d MD5 | raw file
 1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2<html xmlns="http://www.w3.org/1999/xhtml" >
 3<head>
 4    <title>CSActiveX</title>
 5
 6    <script language="javascript" type="text/javascript">
 7        function SetFloatProperty() {
 8            var fVal = parseFloat(floatPropInput.value);
 9            if (!isNaN(fVal)) {
10                CSActiveX1.FloatProperty = fVal;
11            }
12        }
13        function GetFloatProperty() {
14            alert("CSActiveX1.FloatProperty = " +
15                CSActiveX1.FloatProperty.toString());
16        }
17    </script>
18
19    <script language="vbscript" type="text/vbscript" for="CSActiveX1" event="FloatPropertyChanging(NewValue, byref Cancel)">
20'       http://support.microsoft.com/kb/253282
21'       we do not use jscript or javascript because they passes all variables
22'       by value (not by reference). The FloatPropertyChanging event requires 
23'       passing the cancel param by reference.
24        If confirm("FloatProperty is being changed to " & Cstr(NewValue)) Then
25            Cancel = false
26        Else
27            Cancel = true
28        End If
29'       The event is not triggered [to be fixed in future, Jialiang]        
30    </script>
31
32    <style type="text/css">
33        body
34        {
35            font-family: Calibri;
36        }
37        #CSActiveX1
38        {
39            height: 96px;
40            width: 291px;
41        }
42    </style>
43</head>
44<body>
45    <object id="CSActiveX1" classid="CLSID:80B59B58-98EA-303C-BE83-D26E5D8D6794">
46    </object>
47    <p>
48    </p>
49    FloatProperty:
50    <input type="text" name="floatPropInput" value="" style="width: 120px" />
51    <input type="button" name="submit" value="Set" onclick="SetFloatProperty()" />
52    <input type="button" name="retrieve" value="Get" onclick="GetFloatProperty()" />
53</body>
54</html>