delphi中webBrowser控件滚动条自动滚动

uses mshtml;

var    htmldoc: IHTMLDocument2;
      MaxScrollWidth, MaxScrollHeight: Integer;

htmldoc := web.Document as IHTMLDocument2;
MaxScrollHeight := htmldoc.body.getAttribute('ScrollHeight', 0);  //获得滚动条最大高度
MaxScrollWidth := htmldoc.body.getAttribute('ScrollWidth', 0);//获得滚动条最大宽度
Web.OleObject.Document.ParentWindow.ScrollBy(MaxScrollWidth, MaxScrollHeight ); //滚动到最右最下

 

Posted in 软件开发 by 傻猫 at December 27, 2012.
Tags: webbrowser, 滚动条

添加新评论