How can I get\set the scroll position of the vertical scroll bar for the web browser control in WPF?
Asked
Active
Viewed 3,493 times
2 Answers
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
-
will that give the scroll position of the scroll viewer or the broiwser control... – AwkwardCoder Jul 14 '11 at 11:41
-
This is not what i want, the scroll bar in the web browser control is part of the active x control. – AwkwardCoder Jul 14 '11 at 16:06