473,783 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_MouseDow n _

(ByVal sender As System.Object, ByVal e As System.EventArg s) _

Handles Label1.MouseDow n

bSelect = True

End Sub

Nov 20 '05 #1
4 4741
Hi,

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

Private Sub Label1_MouseDow n(ByVal sender As Object, ByVal e As System.Windows. Forms.MouseEven tArgs) Handles Label1.MouseDow n

bSelect = True

End Sub

"rsmith" <rl*****@worldn et.att.net> wrote in message news:%2******** ********@tk2msf tngp13.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_MouseDow n _

(ByVal sender As System.Object, ByVal e As System.EventArg s) _

Handles Label1.MouseDow n

bSelect = True

End Sub

Nov 20 '05 #2
"rsmith" <rl*****@worldn et.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_MouseDow n _

(ByVal sender As System.Object, ByVal e As System.EventArg s) _

Handles Label1.MouseDow n

bSelect = True

End Sub


ByVal e As System.Windows. Forms.MouseEven tArgs
--
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_MouseDow n(ByVal sender As Object, ByVal e As System.Windows. Forms.MouseEven tArgs) Handles Label1.MouseDow n

Cor
Nov 20 '05 #4
"rsmith" <rl*****@worldn et.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_MouseDow n _

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


Replace the 'System.EventAr gs' with 'System.Windows .Forms.MouseEve ntArgs'.

--
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
4397
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 strFullText = Me.lstMyList.Column(4) txtFullText.Visible = True txtFullText = strFullText
2
16321
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
2911
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 textboxes. The datagrid and textboxes are populated from the same underlying SQL Server table but using different strongly typed data adapters and datasets for display and editing. So I coordinate syncronization of the two sets of data using code. I use...
7
8122
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 mousedown to handle mybase.mousedown but it doesn't detect the mousedown event until I move out of the pictureboxes I have created (only works on the part of the form where I don't have any pictureboxes). I also cannot set the mousedown event to...
1
1585
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 Mouse Down event for the UserControl is not detected if the mouse cursor is placed over the label inside the control, i.e the label within the control has trapped the event so I don't get to see it. I've looked at adding the label mousedown...
2
3564
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 because I entered the following Sub Private Sub MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _ Handles AxWebBrowser1.MouseDown
1
2792
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 Private Sub Label1_mouseup(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseUp
7
6786
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 textbox names in the drawing procedure. Now what I need to do is to get the control's information on a mouse down. Here is what I have: //// Private Sub tcGuard_MouseDown(ByVal sender as Object, ByVal e as
1
5219
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 pressed while dragging the Form window to resize it. Can this "problem" be explained as some sort of by-design behavior? If so what is the work around to detecting when a user has completed resizing a Windows Form by way of mouse drag? / ...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.