This is the discussion forum for the HtmlEditor. See also the HtmlEditor home page, where you can download the control, and the Documentation Wiki, a collaborative project for documenting the control.
- Determine the current position of the vertical scroll. (Primarily to determine whether it is at bottom, but it'd be nice to save the current scroll position as well.)
- Change the position of the vertical scroll, either to a previously saved position or to the bottom.
One of the things I need to do is if the scroll bar is at bottom, I need to move it back there after the document is updated. I had a way to do this using GetScrollInfo and SendMessage on other controls, but the HtmlEditor does not seem to respond to these. I thought of trying to use Javascript in the document itself, but I'm having little luck with this approach too...
Heh... never mind. I was trying to be too complicated, looking at WndProc messages or trying Javascript... the answers I needed were in the mshtml.IHTMLElement and mshtml.IHTMLElement2.
IHTMLElement2.scrollTop tells me where the scroll bar is, and I just use the offsetHeight of the various elements of the page minus the IHTMLElement2.clientheight to determine what value of the scroll bar will be at the bottom. It'll also be easy to save IHTMLElement2.scrollTop to restore position when needed. Just had to look in the proper place...