Niek H. Niek H. - 2 months ago 11
C# Question

How to retrieve the scrollbar position of the webbrowser control in .NET

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
.

Answer

OK, I solved it:

Dim htmlDoc As HtmlDocument = wb.Document
Dim scrollTop As Integer = htmlDoc.GetElementsByTagName("HTML")(0).ScrollTop
Comments