PageRenderTime 50ms CodeModel.GetById 18ms 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. <script language="javascript" type="text/javascript">
  6. function SetFloatProperty() {
  7. var fVal = parseFloat(floatPropInput.value);
  8. if (!isNaN(fVal)) {
  9. CSActiveX1.FloatProperty = fVal;
  10. }
  11. }
  12. function GetFloatProperty() {
  13. alert("CSActiveX1.FloatProperty = " +
  14. CSActiveX1.FloatProperty.toString());
  15. }
  16. </script>
  17. <script language="vbscript" type="text/vbscript" for="CSActiveX1" event="FloatPropertyChanging(NewValue, byref Cancel)">
  18. ' http://support.microsoft.com/kb/253282
  19. ' we do not use jscript or javascript because they passes all variables
  20. ' by value (not by reference). The FloatPropertyChanging event requires
  21. ' passing the cancel param by reference.
  22. If confirm("FloatProperty is being changed to " & Cstr(NewValue)) Then
  23. Cancel = false
  24. Else
  25. Cancel = true
  26. End If
  27. ' The event is not triggered [to be fixed in future, Jialiang]
  28. </script>
  29. <style type="text/css">
  30. body
  31. {
  32. font-family: Calibri;
  33. }
  34. #CSActiveX1
  35. {
  36. height: 96px;
  37. width: 291px;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <object id="CSActiveX1" classid="CLSID:80B59B58-98EA-303C-BE83-D26E5D8D6794">
  43. </object>
  44. <p>
  45. </p>
  46. FloatProperty:
  47. <input type="text" name="floatPropInput" value="" style="width: 120px" />
  48. <input type="button" name="submit" value="Set" onclick="SetFloatProperty()" />
  49. <input type="button" name="retrieve" value="Get" onclick="GetFloatProperty()" />
  50. </body>
  51. </html>