请问如何将webBrowser控件中的页面打印出来?

exceed 2002-04-04 10:39:44
请问如何将webBrowser控件中的页面打印出来?
...全文
102 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
y1g1y1 2002-04-04
  • 打赏
  • 举报
回复
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
突击召唤师 2002-04-04
  • 打赏
  • 举报
回复
WebBrowser Printing
The WebBrowser implements its printing capabilities using standard features of the Win32 Application Programming Interface (API), just like any other application. When the user selects File, then Print from Internet Explorer, the WebBrowser goes through the same general printing process that is described in the previous section.

As discussed later, you can call ExecWB to programmatically print the current Web page. However, the WebBrowser does not officially expose any functionality that allows you to control the printing process. Given all of the great flexibility provided by the DOM for controlling the display of content, the fact that you have almost no control over printing can be hard to accept. At first, this seems like a glaring oversight, but in fact this was never a design goal of the product. Internet Explorer was designed to be an end-user application to browse the Web. Developers enjoy a high level of control over the display of content because this is necessary to deliver a great Web-browsing experience for the end user. Unfortunately, control over printing features has not been implemented because this is not seen as a critical factor for the vast majority of end users browsing the Web. Internet Explorer was simply not designed to be a flexible and robust printing or reporting architecture.

This section discusses the various print settings that the user can control in the Page Setup and Print dialog boxes. The ExecWB method is discussed, which is a way of programmatically invoking the printing process. An overview of how the WebBrowser prints is given. Finally, some of the printer-specific aspects that you can stipulate within the HTML content are briefly discussed.

1,451

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧