Add this to a module:
Code:
Imports System.Runtime.InteropServices
<DllImport("User32.dll")> _
Private Sub mouse_event(ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, _
ByVal dwExtraInfo As Integer)
End Sub
Private Const MOUSEEVENTF_WHEEL As Int32 = &H800
Private Const WHEEL_DELTA As Int32 = 120
Public Sub MouseScroll(Optional ByVal intDirection As Integer = 0)
If intDirection = 1 Then
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, -WHEEL_DELTA, 0)
Else
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, WHEEL_DELTA, 0)
End If
End Sub
To scroll up use:
To scroll down use:
To do this when the webbrowser has finished loading you need to use the Webbrowser's 'DocumentCompleted' or 'Navigated' event. (I forget which one it is):
Code:
Private Sub webBrowser_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles webBrowser.Navigated
End Sub
Private Sub webBrowser_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles webBrowser.DocumentCompleted
End Sub