468,247 Members | 1,445 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,247 developers. It's quick & easy.

mouseup has to follow mousedown?

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
' do stuff
End Sub

It seems that the Mouseup event can only be triggered after the mousedown
event has happened. In other words, I can't mousedown on the form somewhere
(not on the label), then drag the mouse over my label, and mouseup, the event
doesn't fire.

Similarly, if you mousedown on the label, then drag your mouse elsewhere,
and mouseup, the event does fire. It seems that that should be a form mouseup
event rather than a label mouseup, since you're not over the label anymore.
Can anyone explain this? Is there a way to make a mouseup event fire
regardless of where you mousedowned?
Nov 21 '05 #1
1 2501

It sounds like you are trying to implement drag-drop functionality. If this
is the case then you need to look at the Clipboard and DataObject classes
and the DataObject.DoDragDrop method. More information can be found that
this link;

http://msdn.microsoft.com/library/de...ardsupport.asp
Hope this helps

Robby

"Alan" <Al**@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
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
' do stuff
End Sub

It seems that the Mouseup event can only be triggered after the mousedown
event has happened. In other words, I can't mousedown on the form
somewhere
(not on the label), then drag the mouse over my label, and mouseup, the
event
doesn't fire.

Similarly, if you mousedown on the label, then drag your mouse elsewhere,
and mouseup, the event does fire. It seems that that should be a form
mouseup
event rather than a label mouseup, since you're not over the label
anymore.
Can anyone explain this? Is there a way to make a mouseup event fire
regardless of where you mousedowned?

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jeremy Robertson | last post: by
4 posts views Thread by Michael Maes | last post: by
12 posts views Thread by Tom Bean | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.