打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
delphi webbrower的滚动条控制
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 ); //滚动到最右最下
var
htmldoc: IHTMLDocument2;
MaxScrollWidth, MaxScrollHeight: Integer;
begin
htmldoc := webbrowser2.Document as IHTMLDocument2;
MaxScrollHeight := htmldoc.body.getAttribute('ScrollHeight', 0); //获得滚动条最大高度
MaxScrollWidth := htmldoc.body.getAttribute('ScrollWidth', 0);//获得滚动条最大宽度
form1.Caption :=IntToStr(MaxScrollHeight)+'  '+IntToStr(MaxScrollWidth);
webbrowser2.OleObject.Document.ParentWindow.ScrollTo(0, 1200 ); //滚动到指定位置
webbrowser2.OleObject.Document.ParentWindow.ScrollBy(0, 120 ); //每次跳着滚动120个相素
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
delphi WebBrowser的使用方法详解(六)
读取WebBrowser网页脚本中的变量
delphi WebBrowser的使用方法详解(五)
WebBrowser 操作记要(万一博客)
SwissDelphiCenter.ch : ...save all TWebbrowser Frame Sources?
Delphi中WebBbrowser的编程
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服