Futronics Developer
2008-05-13 12:00:01 UTC
I'm trying to do my own scrolling with the WebBrowser control (2 large
buttons next to the control).
I can use the WebBrowser.Document.Window.ScrollTo method to scroll to a
specific position but how do I find my current position?
I can keep my own scroll position, I know when the document loads that I'm
at scroll position 0,0. Then each time I scroll (by 200 for example) I just
keep a record of my new scroll position.
This works until I get to the end of the document. The ScrollTo doesn't
return any feedback when it gets to the end of the document, like 'stop' or
'can't scroll' or 'have only scrolled 50'. When the end of the docuument is
reached I would still be calling ScrollTo adding 200 each time to my internal
scroll position. The two would get out-of-sync.
Is there a way to read the current scroll position?
buttons next to the control).
I can use the WebBrowser.Document.Window.ScrollTo method to scroll to a
specific position but how do I find my current position?
I can keep my own scroll position, I know when the document loads that I'm
at scroll position 0,0. Then each time I scroll (by 200 for example) I just
keep a record of my new scroll position.
This works until I get to the end of the document. The ScrollTo doesn't
return any feedback when it gets to the end of the document, like 'stop' or
'can't scroll' or 'have only scrolled 50'. When the end of the docuument is
reached I would still be calling ScrollTo adding 200 each time to my internal
scroll position. The two would get out-of-sync.
Is there a way to read the current scroll position?