By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,683 Members | 1,387 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,683 IT Pros & Developers. It's quick & easy.

MouseDown event on a Label ?

P: n/a
How can I capture the MouseDown event on a Label ?
I entered thr following code and got a " cannot handle
Event 'MouseDown' because they do not have the same
signature."
Private Sub Label1_MouseDown _

(ByVal sender As System.Object, ByVal e As System.EventArgs) _

Handles Label1.MouseDown

bSelect = True

End Sub

Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

The procedure has the wrong arugments for the mousedown event. It should accept mouseventargs not eventargs.

Private Sub Label1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown

bSelect = True

End Sub

"rsmith" <rl*****@worldnet.att.net> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
How can I capture the MouseDown event on a Label ?
I entered thr following code and got a " cannot handle
Event 'MouseDown' because they do not have the same
signature."
Private Sub Label1_MouseDown _

(ByVal sender As System.Object, ByVal e As System.EventArgs) _

Handles Label1.MouseDown

bSelect = True

End Sub

Nov 20 '05 #2

P: n/a
"rsmith" <rl*****@worldnet.att.net> schrieb
How can I capture the MouseDown event on a Label ?
I entered thr following code and got a " cannot handle
Event 'MouseDown' because they do not have the same
signature."
Private Sub Label1_MouseDown _

(ByVal sender As System.Object, ByVal e As System.EventArgs) _

Handles Label1.MouseDown

bSelect = True

End Sub


ByVal e As System.Windows.Forms.MouseEventArgs
--
Armin
Nov 20 '05 #3

P: n/a
Cor
Hi Rsmith,

You had probably first a click event and changed the handles just in mousedown :-).
That cannot because the "event argument" is totaly different.

This is the one from the mousedown.
Private Sub Label1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown

Cor
Nov 20 '05 #4

P: n/a
"rsmith" <rl*****@worldnet.att.net> scripsit:
How can I capture the MouseDown event on a Label ?
Yes, this can be done. Please do not post in HTML format in future
(plain-text is the preferred format).
I entered thr following code and got a*" cannot handle

Event 'MouseDown' because they do not have the same

signature."

Private Sub Label1_MouseDown _

*** (ByVal sender As System.Object, ByVal e As System.EventArgs) _


Replace the 'System.EventArgs' with 'System.Windows.Forms.MouseEventArgs'.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.