Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

VS 2010 [RESOLVED] Mouse buttons on WebBrowser

$
0
0
I am trying to get the mouse events on the WebBrowser.
I found the following code that will do one of the events - but I want it to do middle mouse button down AND middle mouse button up.
I have never used code like this before so I'm not sure how to modify it.
Thanks.

Code:

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        AddHandler WebBrowser1.Document.MouseDown, AddressOf eventSub
    End Sub

    Sub eventSub(ByVal sender As Object, ByVal e As System.Windows.Forms.HtmlElementEventArgs)
        Dim event_html As New HtmlElementEventHandler(AddressOf wbMouseDown)
        event_html.Invoke(sender, e)
    End Sub

    Sub wbMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.HtmlElementEventArgs)
        If e.MouseButtonsPressed = Windows.Forms.MouseButtons.Middle Then
            MsgBox("middle down")
        End If
    End Sub


Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>