且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何滚动System.Windows.Forms.WebBrowser的结束?

更新时间:2023-02-08 18:19:05

  ctlWebBrowser.Document.Body.ScrollIntoView(假);
 

有ScrollIntoView()的布尔参数为真,以配合在文档的顶部滚动条,并假对准滚动条与所述文档的底部。

MSDN文档在这里:HtmlElement.ScrollIntoView

How can you scroll to the end of a System.Windows.Forms.WebBrowser programmatically?

ctlWebBrowser.Document.Body.ScrollIntoView(false);

The boolean parameter for ScrollIntoView() is true to align the scrollbar with the top of the document, and false to align the scrollbar with the bottom of the document.

MSDN documentation here: HtmlElement.ScrollIntoView