0

i want to show a msgbox when i click on the webbrowser control on my form.. how do i do it? why isnt there a mouseclick event in the webbrowser method listbox?

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by Teme64
0

why isnt there a mouseclick event in the webbrowser method listbox?

Because the mouse click is sent to the web page shown in the control. Just like you normally click the web pages in your browser. The explanation above is not totally correct, but I think it's good enough ;)

I don't know why would you like to trap the mouse click, but you could try to use GotFocus event

Private Sub WebBrowser1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser1.GotFocus
  '
  MessageBox.Show("Click", "Click", MessageBoxButtons.OK, MessageBoxIcon.Information)

End Sub

It does have its limitations compared to "normal" Click event.

0

yup i tried using that initially but it doesnt work.. the msgbox showed even before the form appeared.. and the msgbox keeps popping up..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.