3 个解决方案
#1
最简单的
SendKeys "{pageup}"
SendKeys "{pagedown}"
SendKeys "{pageup}"
SendKeys "{pagedown}"
#2
webbrowser1.document.Window.ScrollTo(320, 1520)
#3
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.163.com/"
End Sub
Private Sub Command1_Click()
MsgBox WebBrowser1.Document.body.scrollwidth
MsgBox WebBrowser1.Document.body.scrollheight
'移动到窗口的中间
WebBrowser1.Document.ParentWindow.Scroll WebBrowser1.Document.body.scrollwidth / 2, WebBrowser1.Document.body.scrollheight / 2
End Sub
WebBrowser1.Navigate "http://www.163.com/"
End Sub
Private Sub Command1_Click()
MsgBox WebBrowser1.Document.body.scrollwidth
MsgBox WebBrowser1.Document.body.scrollheight
'移动到窗口的中间
WebBrowser1.Document.ParentWindow.Scroll WebBrowser1.Document.body.scrollwidth / 2, WebBrowser1.Document.body.scrollheight / 2
End Sub
#1
最简单的
SendKeys "{pageup}"
SendKeys "{pagedown}"
SendKeys "{pageup}"
SendKeys "{pagedown}"
#2
webbrowser1.document.Window.ScrollTo(320, 1520)
#3
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.163.com/"
End Sub
Private Sub Command1_Click()
MsgBox WebBrowser1.Document.body.scrollwidth
MsgBox WebBrowser1.Document.body.scrollheight
'移动到窗口的中间
WebBrowser1.Document.ParentWindow.Scroll WebBrowser1.Document.body.scrollwidth / 2, WebBrowser1.Document.body.scrollheight / 2
End Sub
WebBrowser1.Navigate "http://www.163.com/"
End Sub
Private Sub Command1_Click()
MsgBox WebBrowser1.Document.body.scrollwidth
MsgBox WebBrowser1.Document.body.scrollheight
'移动到窗口的中间
WebBrowser1.Document.ParentWindow.Scroll WebBrowser1.Document.body.scrollwidth / 2, WebBrowser1.Document.body.scrollheight / 2
End Sub