473,387 Members | 1,863 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,387 software developers and data experts.

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 2767

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

Similar topics

1
by: Jeremy Robertson | last post by:
I'm working on an application that manages large image files (mulit-page ..Tiff's to be exact some 1000+ pages). I've written an user control that displays a number of the images as thumbnails...
4
by: Colin McGuire | last post by:
Hi again, thanks everyone for your previous help. But having resolved past problems, I'm moving on to new problems :( This one is a simple winforms application with two buttons, named Button1...
4
by: Michael Maes | last post by:
Hi, I have a child-form in an MDI-Application which seems to loose the MouseUp-Event. I grid (for navigation-purpose) appears on many of the child-forms and in (I think) only one this issue...
2
by: dave.wayne | last post by:
In a web page I have a div tag that has a onlick event registered through the event listener. However, that same div tag also has a onmousedown - start a drag and drop script The problem I am...
3
by: Techsatish | last post by:
how to make a mouseup event called only once during a double click event? here double click is made on a tree node in a tree control. I have the code inside mouseup event....in runtime the...
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...
2
by: charlieopenshaw | last post by:
I have a form listview and have used the MouseDown event to launch a modal dialog if a particular cell is clicked. This works fine but upon closing the dialog I am left with a dotted rectangle...
12
by: Tom Bean | last post by:
I am trying to display a ContextMenuStrip when a user right-clicks on an item in a ListView and have encountered a something that seems strange to me. When the ListView is initially populated,...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.