如何在.NET中检索Web浏览器控件的滚动条位置 [英] How to retrieve the scrollbar position of the webbrowser control in .NET
本文介绍了如何在.NET中检索Web浏览器控件的滚动条位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用 webBrowser1.Document.Body.ScrollTop
和 webBrowser1.Document.Body.ScrollLeft
,但是它们不行它们总是返回0,而我无法访问 webBrowser1.Document.documentElement.ScrollTop
和 .ScrollLeft
。
I tried using webBrowser1.Document.Body.ScrollTop
and webBrowser1.Document.Body.ScrollLeft
, but they don't work. They always return 0 and I can't access webBrowser1.Document.documentElement.ScrollTop
and .ScrollLeft
.
推荐答案
好,我解决了:
Dim htmlDoc As HtmlDocument = wb.Document
Dim scrollTop As Integer = htmlDoc.GetElementsByTagName("HTML")(0).ScrollTop
这篇关于如何在.NET中检索Web浏览器控件的滚动条位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文