选择系统字体的控件
<OBJECT id="dlgHelper" CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>
<select id="the_font"></select>
<script>
function setFont()
{
var cnt = dlgHelper.fonts.countfor (var i = 1; i < cnt; i++)
{
the_font.options[the_font.options.length] = new Option(dlgHelper.fonts(i),dlgHelper.fonts(i));
}
}
window.onload = setFont;
</script>
<OBJECT id="dlgHelper" CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>
<select id="the_font"></select>
<script>
function setFont()
{
var cnt = dlgHelper.fonts.countfor (var i = 1; i < cnt; i++)
{
the_font.options[the_font.options.length] = new Option(dlgHelper.fonts(i),dlgHelper.fonts(i));
}
}
window.onload = setFont;
</script>
解决方案 »
- 发布一基于ajax的BLOG系统供下载,请大家去踩踩
- 在WEB开发中大量使用JavaScript好不好
- 请教点关于EXTJS的问题。。麻烦高手进来指教下。谢谢。。
- 套钎DIV onmouseover的问题
- 正则
- 如何取object里 data='*.htm' 上的控件值?
- 关于菜单显示相关问题,求代码
- 怎么写?当用户选择该“单选框”时,后面的文本框才是“visalbe"状态,否则文本框是”disabled"
- 简单的问题。框架里面函数如何调用啊??
- 求助
- ONKEYPRESS="event.returnValue=IsDigit();"帮忙看看这个代码JAVASCRIPT不是很清楚
- String对象的valueOf方法怎么用?哪位老大给我一个例子?
CLASSID="CLSID:F9043C85-F6F2-101A-A3C9-08002B2F49FB"
CODEBASE="http://activex.microsoft.com/controls/vb5/comdlg32.cab
#Version=1,0,0,0">
</OBJECT>
<span id=Text1>测试OK</span>
<input type=button value="open" onclick="showclr();">
<script>
function showclr()
{
CommonDialog1.CancelError = true;
CommonDialog1.Flags = 259;
CommonDialog1.ShowFont();
Text1.style.fontFamily = CommonDialog1.FontName;
Text1.style.fontSize = CommonDialog1.FontSize;
Text1.style.color = CommonDialog1.Color;
}
</script>