M
M
Maxim Anarchistov2015-07-08 22:42:12
.NET
Maxim Anarchistov, 2015-07-08 22:42:12

C# How to detect mouse capture event on webbrowser?

I have a webbrowser on a form and I need to perform an action while the cursor is moving over the webbrowser.
But webbrowser doesn't have events to capture mouse actions.
How to bypass the restriction?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Larry Underwood, 2015-07-08
@ozonar

WinForms:
What about MouseHover?
But what about MouseMove?
MSDN insistently says that the mouse capture event is
UPD: oops, I'm sorry for the misinformation, at night looking mosk refused to think.
here is the code that works

public Form1()
    {
      InitializeComponent();
      this.webBrowser1.Navigate("http://yandex.ru");
      this.webBrowser1.DocumentCompleted += webBrowser1_DocumentCompleted;
     
    }

    void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
      this.webBrowser1.Document.Body.MouseOver += this.Body_MouseOver;
    }

    void Body_MouseOver(object sender, HtmlElementEventArgs e)
    {
      e.ToString();
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question