一个TWebBrowser的问题,怎么控制TWebBrowser翻页?(200分)

  • 主题发起人 主题发起人 g_liyang
  • 开始时间 开始时间
G

g_liyang

Unregistered / Unconfirmed
GUEST, unregistred user!
各位大虾:
小弟需要用一TWebBrowser显示内容,并且不断在此控件中不断添加新内容,我是采用
IHTMLDocument2的Write方法往里面写东西,我想让TWebBrowser显示最新的记录就需要
自动翻页,我应该如何控制它呢?
 
没人知道??
 
是上下滚动还是新开一页?
 
sendmessage(TWebBrowser1.Handle,Scroll_PageUp,0)
sendmessage(TWebBrowser1.Handle,Scroll_Pagedown,0)
 
不明白,说清楚一点.[:D]
 
你可以用API来控制它,当估计写满一页时下翻一页:
SendMessage(WebBrowser1.Handle, WM_VSCROLL, SB_PAGEDOWN, 0);

[blue]SB_BOTTOM Scrolls to the lower right.
SB_ENDSCROLL Ends scroll.
SB_LINEDOWN Scrolls one line down.
SB_LINEUP Scrolls one line up.
SB_PAGEDOWN Scrolls one page down.
SB_PAGEUP Scrolls one page up.
SB_THUMBPOSITION Scrolls to the absolute position. The current position is specified by the nPos parameter.
SB_THUMBTRACK Drags scroll box to the specified position. The current position is specified by the nPos parameter.
SB_TOP Scrolls to the upper left.[/blue]
 
正确的方法应该是:
uses mshtml_tlb;  

Ihtml2window(ihtmldocument2(webbrowser.document).Parentwindow).scrollby(x,y)


 
SendMessage(WebBrowser1.Handle, WM_VSCROLL, SB_PAGEDOWN, 0);也可以实现
Delphi6+Win2K
 
多人接受答案了。
 
后退
顶部