我在 VB6 中使用表单应用程序尝试了字体对话框,它可以启动字体对话框,但是当我尝试在 javascript 中执行相同操作时,它失败并出现异常:
由于错误 800a8000 无法完成操作
在调用 ShowFont() 的行。
这是我的 html 代码:有什么想法吗?
<html>
<head>
<title>test</title>
</head>
<script>
function doclick() {
var fontDlg = document.all.fontDlg
//var fontDlg = new ActiveXObject("MSComDlg.CommonDialog");
/*
cdlCCRGBInit = 1;
cdlCCFullOpen = 2;
cdlCCPreventFullOpen = 4;
fontDlg.Flags = (cdlCCRGBInit | cdlCCFullOpen | cdlCCPreventFullOpen);
fontDlg.CancelError = false;
fontDlg.Min = 8;
fontDlg.Max = 72;
fontDlg.DialogTitle = "Change font settings";
fontDlg.ShowFont();
//fontDlg.ShowColor();
*/
fontDlg.ShowFont();
}
</script>
<body>
<input type=button onclick=doclick() value="click me"/>
<OBJECT id="fontDlg" style="LEFT: 224px; POSITION: absolute; TOP: 24px" classid="clsid:F9043C85-F6F2-101A-A3C9-08002B2F49FB" CODEBASE="http://activex.microsoft.com/controls/vb5/comdlg32.cab #Version=1,0,0,0">
<PARAM NAME="_ExtentX" VALUE="847">
<PARAM NAME="_ExtentY" VALUE="847">
<PARAM NAME="_Version" VALUE="393216">
<PARAM NAME="CancelError" VALUE="0">
<PARAM NAME="Color" VALUE="0">
<PARAM NAME="Copies" VALUE="1">
<PARAM NAME="DefaultExt" VALUE="">
<PARAM NAME="DialogTitle" VALUE="">
<PARAM NAME="FileName" VALUE="">
<PARAM NAME="Filter" VALUE="">
<PARAM NAME="FilterIndex" VALUE="0">
<PARAM NAME="Flags" VALUE="0">
<PARAM NAME="FontBold" VALUE="">
<PARAM NAME="FontItalic" VALUE="">
<PARAM NAME="FontName" VALUE="">
<PARAM NAME="FontSize" VALUE="">
<PARAM NAME="FontStrikeThru" VALUE="0">
<PARAM NAME="FontUnderLine" VALUE="0">
<PARAM NAME="FromPage" VALUE="0">
<PARAM NAME="HelpCommand" VALUE="0">
<PARAM NAME="HelpContext" VALUE="0">
<PARAM NAME="HelpFile" VALUE="">
<PARAM NAME="HelpKey" VALUE="">
<PARAM NAME="InitDir" VALUE="">
<PARAM NAME="Max" VALUE="0">
<PARAM NAME="Min" VALUE="0">
<PARAM NAME="MaxFileSize" VALUE="260">
<PARAM NAME="PrinterDefault" VALUE="1">
<PARAM NAME="ToPage" VALUE="0">
<PARAM NAME="Orientation" VALUE="1">
</OBJECT>
</body>
</html>