2

How can I get\set the scroll position of the vertical scroll bar for the web browser control in WPF?

AwkwardCoder
  • 24,893
  • 27
  • 82
  • 152

2 Answers2

0

As the following question and answer hints at, accessing the scrolling position of the browser control through the Document property (and therefore via the COM interfaces) does not work. The code will compile and run but the values will always be null.

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

As one of the coments suggests, the use of javascript works. By using the InvokeScript method I was able to get and set the scroll bar position.

I wrote a blog post about this, here.

Community
  • 1
  • 1
AwkwardCoder
  • 24,893
  • 27
  • 82
  • 152
-2

You can include WebBrowser control in ScrollViewer Control And then you can use ScrollViewer.ScrollToVerticalOffset(Offset);

Muhammad Al-Own
  • 237
  • 3
  • 13