473,573 Members | 2,918 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Single vs. Doucble Click

I would like three states on an icon ...

Left Click
Right Click
Double Click

Left Click is fired at least once on a Double Click

Is there a good example that shows how to determine if the user entered a
Left Click or a Double Click?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

Nov 16 '05 #1
14 3537
I am not sure what control you are using but my best suggestion would be to
derive from the control you want to use, and lets just it's the picturebox
control. I would add the three properties you want to keep track of, and
within the onClick, and onDoubleClick methods. I would modify the state of
those three properties.
Keenan
"Thom Little" <th**@tlanet.ne t> wrote in message
news:%2******** **********@TK2M SFTNGP12.phx.gb l...
I would like three states on an icon ...

Left Click
Right Click
Double Click

Left Click is fired at least once on a Double Click

Is there a good example that shows how to determine if the user entered a
Left Click or a Double Click?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

Nov 16 '05 #2
Maybe wait for a set period to see if the next click comes?
You would not be able to do this in the event handler but would have to
start a "process" that would be cancelled by the double click.
Maybe start a timer and in the timer event set the click icon and in the
double click event stop the timer.
HTH
JB

"Thom Little" <th**@tlanet.ne t> wrote in message
news:%2******** **********@TK2M SFTNGP12.phx.gb l...
I would like three states on an icon ...

Left Click
Right Click
Double Click

Left Click is fired at least once on a Double Click

Is there a good example that shows how to determine if the user entered a
Left Click or a Double Click?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

Nov 16 '05 #3
Hi Thom,

Based on my understanding, you want to distinguish left click with double
click.

Can your tell me what is your "icon"? Is it a WinForm control?

For a control, you may handle this through Control.Click event and
DoubleClick event. Or you may override the control, handle in both OnClick
and OnDoubleClick protected method.

Does this meet your need?

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #4
I am using System.Windows. Forms.NotifyIco n and would like to service events
for ...

Left Click
Right Click
DoubleClick

I do not currently have Left Click enabled.
DoubleClick works fine.
Right Click is assigned to the context menu and it works fine.

If I enable Left Click it is raised ...

Once for a Left Click
Twice for a DoubleClick
Once for a Right Click

Is there an obvious routine for isolating this behavior to easily determine
a ...

Left Click
Left DoubleClick
Right Click
Right DoubleClick

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

""Jeffrey Tan[MSFT]"" <v-*****@online.mi crosoft.com> wrote in message
news:0C******** ******@cpmsftng xa06.phx.gbl...
Hi Thom,

Based on my understanding, you want to distinguish left click with double
click.

Can your tell me what is your "icon"? Is it a WinForm control?

For a control, you may handle this through Control.Click event and
DoubleClick event. Or you may override the control, handle in both OnClick
and OnDoubleClick protected method.

Does this meet your need?

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #5
Hi Thom,

Thanks for your feedback.

Based on my understanding, I think you do not want the single click logic
when double click occurs.

=============== ===============
Actually, in windows system, all events are driven by messages. For mouse
events, if you double click your mouse, the single click message will first
occur for you.
This is by design. Because double click is consistute of 2 single click,
which click internal is less than certain value. When the first single
click occurs, the system can not know if it is a "pure" single click or is
just a "part" of double click. So system also will fire single click for
you.

For your request, the only workaround I can think of is delay the single
click code logic. That is: when single click occurs, we can delay a certain
time, to see if another single click is comming, if it comes, we discard
the single click code, but process the double click logic. But if there is
no another single click occurs, we can just process the single click logic.

The key point is to determine the "certain" time to delay. This time should
be a little longer than the system double click time.(Which is stored in
windows system, you can configure it through control panel). In C#, we can
P/invoke GetDoubleClickT ime Win32 API to get this value. Then you can use
Timer control to do the delay.

=============== ===============
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #6
Hi Thom,

Thanks for your feedback.

Based on my understanding, I think you do not want the single click logic
when double click occurs.

=============== ===============
Actually, in windows system, all events are driven by messages. For mouse
events, if you double click your mouse, the single click message will first
occur for you.
This is by design. Because double click is consistute of 2 single click,
which click internal is less than certain value. When the first single
click occurs, the system can not know if it is a "pure" single click or is
just a "part" of double click. So system also will fire single click for
you.

For your request, the only workaround I can think of is delay the single
click code logic. That is: when single click occurs, we can delay a certain
time, to see if another single click is comming, if it comes, we discard
the single click code, but process the double click logic. But if there is
no another single click occurs, we can just process the single click logic.

The key point is to determine the "certain" time to delay. This time should
be a little longer than the system double click time.(Which is stored in
windows system, you can configure it through control panel). In C#, we can
P/invoke GetDoubleClickT ime Win32 API to get this value. Then you can use
Timer control to do the delay.

=============== ===============
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #7
Thanks for the lead.

I did it with a timer and testing ButtonDown for a Left Click.

I then abandoned the capability.

The icon is too small and the mouse clicking has to be too precise. In
addition the timing will vary from machine to machine and I think it will be
prone to failure.

I settled for double-click and single right click for my application.

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

""Jeffrey Tan[MSFT]"" <v-*****@online.mi crosoft.com> wrote in message
news:id******** ******@cpmsftng xa06.phx.gbl...
Hi Thom,

Thanks for your feedback.

Based on my understanding, I think you do not want the single click logic
when double click occurs.

=============== ===============
Actually, in windows system, all events are driven by messages. For mouse
events, if you double click your mouse, the single click message will first occur for you.
This is by design. Because double click is consistute of 2 single click,
which click internal is less than certain value. When the first single
click occurs, the system can not know if it is a "pure" single click or is
just a "part" of double click. So system also will fire single click for
you.

For your request, the only workaround I can think of is delay the single
click code logic. That is: when single click occurs, we can delay a certain time, to see if another single click is comming, if it comes, we discard
the single click code, but process the double click logic. But if there is
no another single click occurs, we can just process the single click logic.
The key point is to determine the "certain" time to delay. This time should be a little longer than the system double click time.(Which is stored in
windows system, you can configure it through control panel). In C#, we can
P/invoke GetDoubleClickT ime Win32 API to get this value. Then you can use
Timer control to do the delay.

=============== ===============
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #8
Hi Thom,

Thanks very much for your feedback.

Do you still have any concern on this issue? If you need further help,
please feel free to feedback, I will help you. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #9
Thanks for the lead.

I did it with a timer and testing ButtonDown for a Left Click.

I then abandoned the capability.

The icon is too small and the mouse clicking has to be too precise. In
addition the timing will vary from machine to machine and I think it will be
prone to failure.

I settled for double-click and single right click for my application.

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

""Jeffrey Tan[MSFT]"" <v-*****@online.mi crosoft.com> wrote in message
news:id******** ******@cpmsftng xa06.phx.gbl...
Hi Thom,

Thanks for your feedback.

Based on my understanding, I think you do not want the single click logic
when double click occurs.

=============== ===============
Actually, in windows system, all events are driven by messages. For mouse
events, if you double click your mouse, the single click message will first occur for you.
This is by design. Because double click is consistute of 2 single click,
which click internal is less than certain value. When the first single
click occurs, the system can not know if it is a "pure" single click or is
just a "part" of double click. So system also will fire single click for
you.

For your request, the only workaround I can think of is delay the single
click code logic. That is: when single click occurs, we can delay a certain time, to see if another single click is comming, if it comes, we discard
the single click code, but process the double click logic. But if there is
no another single click occurs, we can just process the single click logic.
The key point is to determine the "certain" time to delay. This time should be a little longer than the system double click time.(Which is stored in
windows system, you can configure it through control panel). In C#, we can
P/invoke GetDoubleClickT ime Win32 API to get this value. Then you can use
Timer control to do the delay.

=============== ===============
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #10

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

Similar topics

11
535
by: Thom Little | last post by:
I would like three states on an icon ... Left Click Right Click Double Click Left Click is fired at least once on a Double Click Is there a good example that shows how to determine if the user entered a Left Click or a Double Click?
0
1104
by: Jeff Louie | last post by:
I am running into a problem using the OpenFileDialog box when single click is enabled. I am running WinXPP SP2, Visual Studio 2003, Windows Forms. I am getting a lot of null exceptions in an unknown module. I believe it is related to the fact that when I click on a file in the OpenFileDialog with single click enabled, the user never gets to...
3
3635
by: R Millman | last post by:
under ASP.NET, single stepping in debug mode appears not to stop within event procedures. i.e. 1) Create web page with submit button and event procedure for the click event in the code behind page, 2) Breakpoint in the Page_Load, 3) debug the web page and click the submit button, 4) "step into" under debug several times, 5) The debugger...
6
8622
by: Sakharam Phapale | last post by:
Hi All, How to capture Mouse Single click and mouse double click event on Commnad Button. I am doing as follows. Private Sub Button1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseUp If e.Clicks = 1 Then
3
2929
by: Siv | last post by:
Hi, I have a ListView control in a Windows application, currently single clicking a customer name in this list, selects the customer and displays their details in text boxes to the right of the list. The user must then click a button to select that customer and move off the page to the main database details. I would like to implement being...
2
9494
by: cumars | last post by:
Hello Friends, I want to trigger both the click event and double click event in a single button separately. (i.e.) the user can trigger both the single click and the double click event. if they click once, it should trigger single click event. if they click twice, it should trigger double click event. please Help. ...
8
8476
by: starrysky | last post by:
I have a program which puts an icon in the notification area and has a menu associated with it available by right clicking on the icon. I want the menu items to be selected by single left clicks but I also want the user to be able to single left click on the icon itself to do some other functionality. Here's the problem - the single click on...
0
7780
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7694
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...
0
8021
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. ...
0
8065
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...
0
6419
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...
1
5593
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...
0
3733
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1303
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1041
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...

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.