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

handle doubleclick without handling click

Dear all,
I am interested in mouse down and double click events of a control.
When doubleclick happens the processing for mouse down should't be done
I did follwing:
sub MyMouseDown(.) handles MouseDown(..)
if e.clicks>1 then return 'This is double click <-----------------(*)
....
end sub
sub DoubleClick(.) handles DoubleClick(..)
end sub

unfortunately when doubleclick happens the simple click seems to happen too.
So (*) don't filter out double clicks.
What is a proper way to handle this problem?
Thanks,
Boni
Nov 21 '05 #1
2 3342
"Boni" <oilia@nospam> schrieb:
I am interested in mouse down and double click events of a control.
When doubleclick happens the processing for mouse down should't be done
I did follwing:
sub MyMouseDown(.) handles MouseDown(..)
if e.clicks>1 then return 'This is double click <-----------------(*)
...
end sub
sub DoubleClick(.) handles DoubleClick(..)
end sub

unfortunately when doubleclick happens the simple click seems to happen
too.
This behavior is by design. Otherwise it would be impossible to raise the
'Click' event directly after the click is performed by the user.
What is a proper way to handle this problem?


You could check if the time distance between the first and the second click
is greater than 'SystemInformation.DoubleClickTime', and raise the 'Click'
event after the period has elapsed and no consecutive click was performed.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
For a double click be considered a "double-click", the mouse must be clicked
twice within the System.Information.DoubleClickTime property and within the
System.Information.DoubleClickSize area.

The MouseEventArgs has a property that lets you detect the number of clicks
within these parameters, i.e., MouseEventArgs.Clicks.
--
Dennis in Houston
"Herfried K. Wagner [MVP]" wrote:
"Boni" <oilia@nospam> schrieb:
I am interested in mouse down and double click events of a control.
When doubleclick happens the processing for mouse down should't be done
I did follwing:
sub MyMouseDown(.) handles MouseDown(..)
if e.clicks>1 then return 'This is double click <-----------------(*)
...
end sub
sub DoubleClick(.) handles DoubleClick(..)
end sub

unfortunately when doubleclick happens the simple click seems to happen
too.


This behavior is by design. Otherwise it would be impossible to raise the
'Click' event directly after the click is performed by the user.
What is a proper way to handle this problem?


You could check if the time distance between the first and the second click
is greater than 'SystemInformation.DoubleClickTime', and raise the 'Click'
event after the period has elapsed and no consecutive click was performed.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

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

Similar topics

6
by: R.Wieser | last post by:
Hello All, I'm trying to get a "Virtual Listbox" to work. I've currently got a form, and used CreateWindowExA to create a ListBox with the LBS_OWNERDRAWFIXED and LBS_NODATA flags on it. I've...
2
by: JoeHenrich | last post by:
I am using VS.NET 2003 and am having an interesting issue with a Listbox control. Essentially, I have a form with a listbox on it. In the listbox doubleclick event I would like to do some...
7
by: Sue & Bill | last post by:
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...
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...
3
by: Bob | last post by:
My control pops a menu (below, not directly under, the pointer) OnMouseDown, and, probably because of the loss of focus, OnDoubleClick doesn't fire any more. Is there a way to get doubleclick back...
1
by: Marcel Brekelmans | last post by:
Hello, I have implemented a NotiFyIcon and am using both DoubleClick and Click events. But the Doubleclick action on my icon also fires the Click event. Am I missing some setting somewhere or is...
5
by: celestialgal86 | last post by:
Hi everyone... I'm a starter at .Net programming, and I need some help. I was asked to develop a console app that will auto-hide the console window and show a system tray icon. And by...
3
by: Zytan | last post by:
I can handle DoubleClick on a ListBox to respond, not when the selection changes, but when you double click one to invoke an action. This is the same as using the keys to move the selection, then...
3
by: | last post by:
I have a control that need to perform one behavior when it's Clicked and a different behavior when it's DoubleClicked. It seems that you can't get a DoubleClick without first getting a Click. So...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
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...

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.