现在的位置: 首页 > 综合 > 正文

利用WebBrowser控件进行打印,隐藏控件

2013年11月30日 ⁄ 综合 ⁄ 共 589字 ⁄ 字号 评论关闭
<!--media=print 这个属性说明可以在打印时有效-->
<!--打印时不显示的内容,class="Noprint"-->
<!--人为设置分页的位置,class="PageNext"-->
    <style media="print">
    .Noprint{display:none;}
    .PageNext{page-break-after:always;}
    </style>
<!--IE内置打印控件IEWebBrowser-->              
<OBJECT id="WebBrowser" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"> 
</OBJECT> 
<input onclick="document.all.WebBrowser.ExecWB(7,1)" class="Noprint" type="button" value="打印预览">
<input onclick="document.all.WebBrowser.ExecWB(8,1)" class="Noprint"  type="button" value="页面设置"> 
<input onclick="document.all.WebBrowser.ExecWB(6,6)" class="Noprint" type="button" value="直接打印">

抱歉!评论已关闭.