I'm trying to scroll to the bottom of my displayed TWebBrowser
document programmatically.
I've tried using the scroll
method:
uses
MSHTML;
procedure TForm1.Button1Click(Sender: TObject);
var
Document: IHTMLDocument2;
begin
Document := WebBrowser.Document as IHTMLDocument2;
Document.parentWindow.scroll(0, Document.body.offsetHeight);
end;
I also tried using ScrollIntoView(false);
:
procedure TForm1.Button1Click(Sender: TObject);
var
Document: IHTMLDocument2;
begin
Document := WebBrowser.Document as IHTMLDocument2;
Document.Body.ScrollIntoView(false);
end;