(web.document as IHTMLdocument2).body.innerHTML := GetHtml(msgList); //SendMessage(web.Handle, WM_VSCROLL, SB_PAGEDOWN, 0); //SendMessage(web.Handle, WM_VSCROLL, SB_BOTTOM, 0); //(web.document as IHTMLdocument2).Get_ParentWindow.scrollBy(10, 10); //(web.document as IHTMLdocument2).Get_ParentWindow.scrollBy(0, 1024);//跳到最后一行
(web.document as IHTMLdocument2).Get_ParentWindow.scroll(0, ((web.document as IHTMLdocument2).body as DispHTMLBody).scrollHeight);//滚动到底部 //相当于 window.scroll(0,document.body.scrollHeight)//滚动到底部//就是说 javascrip 中能控制的在程序中基本上也可以
//(web.document as IHTMLdocument2).body. //except //end;
procedure TForm1.Button4Click(Sender: TObject); begin ((WebBrowser1.document as IHTMLdocument2).selection.createRange as IHTMLTxtRange).pasteHTML('aaa'); ((WebBrowser1.document as IHTMLdocument2).selection.createRange as IHTMLTxtRange).pasteHTML(''); end;