473,327 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

MouseDown event on a Label ?

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
4 4714
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
"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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Deborah V. Gardner | last post by:
I have a list box and would like to point to an item and have a textbox popup referencing a column in the list box. On the list box's MouseDown event I have the following Dim strFullText ...
2
by: JJ | last post by:
Hi All, I need to create a MouseDown event for a picture box . Am I doing the following right? pictureBox.MouseDown += new System.WinForms.MouseEventHandler(pictureBox_MouseDown) Then
1
by: GregM | last post by:
I have a read only datagrid that is designed to coordinate itself with textboxes. When the user clicks on a row in the datagrid, detailed data for that row is displayed for editing in the...
7
by: Scott Mackay | last post by:
Hi, I'm using visual studio dotnet 2002 programming in vb can anyone tell me how I can handle the mousedown event for pictureboxes I create dynamically at runtime? I've tried setting the...
1
by: Merlin | last post by:
I have created a UserControl which has a label; what I wish to do is place this UserControl on a form and then trap the Mouse Down event, whenever someone clicks my control. My problem is that the...
2
by: Rob | last post by:
How can I fix the following warning warning BC40004: sub 'MouseDown' conflicts with event 'MouseDown' in the base class 'Control' and so should be declared 'Shadows'. This warning appears...
1
by: Alan | last post by:
i have a form with a label on it Private Sub Label1_mousedown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown ' do stuff End Sub ...
7
by: Brad | last post by:
I have several labels and textboxes that are drawn to a tab page based on certain criteria so these labels and textboxes can be drawn at different points on the tab page. I set the label and...
1
by: JDeats | last post by:
It appears the WinForm MouseDown and MouseUp event handlers are not working properly. In the "bare bones" sample application below, Form1_MouseUp gets called even through the mouse button remains...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.