473,407 Members | 2,320 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,407 software developers and data experts.

MouseUp and DoubleClick

Does a double click action also generate two MouseUp events?

If so, what is a good method in my MouseUp event handler to detect that
a MouseUp is part of a double click action?

Thanks in advance.

Nov 17 '05 #1
7 9205
If by double click action you mean having the mouse button be clicked twice
on a given control in order to cause a double click, then yes, two MouseUp
events would end up being fired.

My best suggestion would be to limit the work done on a MouseUp event so
that if fired it does not interfere with a possible later DoubleClick event.

Brendan
"Sue & Bill" wrote:
Does a double click action also generate two MouseUp events?

If so, what is a good method in my MouseUp event handler to detect that
a MouseUp is part of a double click action?

Thanks in advance.

Nov 17 '05 #2
I am doing graphics and can't avoid handling MouseDown and MouseUp.
How do people manage in such circumstances? That is, how can I tell
that a MouseUp is part of a double click and should be ignored?

Thanks

Nov 17 '05 #3
Try with the timer function.

I test and get this miliseconds marks
in a single click
down event 35937.86
up event 35938
click event 35938

in a double click
down 35938.97
up 35939.06
click 35939.06
db 35939.16
up 35939.27

you can check the miliseconds marks between events and discards when
need it.

Sorry for my english.
Regards

Nov 17 '05 #4
I agree with Roer, some sort of timing or flag method is really your only
choice because you could not have a DoubleClick event cancel a previously
fired event.

One method might be to setup a timer that triggers the MouseUp event to
complete (after being initially fired) some interval after it was actually
triggered, only if a flag remains set, a flag that is altered when the
DoubleClick event is fired.

Brendan
"ro*********@gmail.com" wrote:
Try with the timer function.

I test and get this miliseconds marks
in a single click
down event 35937.86
up event 35938
click event 35938

in a double click
down 35938.97
up 35939.06
click 35939.06
db 35939.16
up 35939.27

you can check the miliseconds marks between events and discards when
need it.

Sorry for my english.
Regards

Nov 17 '05 #5
Thanks all. I have done that. Now, any tips on how to retrieve that
double click interval setting from Windows?

Brendan Grant wrote:
I agree with Roer, some sort of timing or flag method is really your only
choice because you could not have a DoubleClick event cancel a previously
fired event.

One method might be to setup a timer that triggers the MouseUp event to
complete (after being initially fired) some interval after it was actually
triggered, only if a flag remains set, a flag that is altered when the
DoubleClick event is fired.

Brendan
"ro*********@gmail.com" wrote:
Try with the timer function.

I test and get this miliseconds marks
in a single click
down event 35937.86
up event 35938
click event 35938

in a double click
down 35938.97
up 35939.06
click 35939.06
db 35939.16
up 35939.27

you can check the miliseconds marks between events and discards when
need it.

Sorry for my english.
Regards


Nov 17 '05 #6
Hard to find, but here is
Declare Function GetDoubleClickTime Lib "user32.dll" () As Long

Private Sub Command1_Click()
Dim doubletime As Long
doubletime = GetDoubleClickTime()
Text1 = Str(doubletime) + " Millisecond(s)"
End Sub

Founded at http://www.vbcode.com/Asp/showsn.asp?theID=6126
Thanks to Author: Ayan Chaudhuri

Nov 17 '05 #7
(y) Thanks.

Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark Schwarz | last post by:
Hello everyone, I've a problem using SetCapture and MouseUp events. I've done an app that is doing SetCapture(Handle) on a buttonclick event and have a mouseup event that shows a MessageBox and...
5
by: David Lozzi | last post by:
Hey All, I have a listbox that I would like to fire an event on doubleclick. the onDoubleClick property of the listbox isnt available be default, and I know it will work with Javascript, but how...
4
by: Tor Inge Rislaa | last post by:
DoubleClick in DataGrid Hi I have a Datagrid bound to a dataset that I want to write a DoubleClick procedure on. My problem is that the DoubleClick event is raised only when DoubleClicking the...
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 ...
3
by: C Glenn | last post by:
I would like one DoubleClick event handler to handle all double clicks throughout a DataGrid. I've assigned a DoubleClick event handler to the DataGrid and it works nifty-spiffy so long as I click...
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...
2
by: techsatish | last post by:
Hi, I want the double click event to call(here not able to get the MouseEventArgs) and execute the mouseup event code or any one tell me how to make my treecontrol double click nodes to behave...
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...
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
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...
0
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,...
0
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...

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.