Click x MouseDown

Posted on 2009-05-17
Last Modified: 2012-05-07

I would like to know if there is a way to identify a click or MouseDown event. I am making this question because MouseDown events is trigged before Click in, but, MouseDown could be a "drag" event instead of click event. Is there a way to isolate both?

Thank you
Question by:jr_barros_jr
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3

Expert Comment

ID: 24405883
You could start a timer on mousedown and end it on mouseup.
Then, specify that if time was shorter than X ( for expample 10ms) it was a click, and longer ( X > 10ms ) it was a Drag.

Author Comment

ID: 24405908

I though to do that, but the problem is that Timer will depends on computer reaches IDLE and it can take more than "click time".

LVL 63

Expert Comment

by:Fernando Soto
ID: 24406517
Hi jr_barros_jr;

From Microsoft documentation: Implementing Drag and Drop in Visual Basic .NET

The above shows how to keep track of the mouse down status.

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 24406616
I can't use "GiveFeedback". How can I use it?
LVL 63

Expert Comment

by:Fernando Soto
ID: 24406698
Hi r_barros_jr;

Control.GiveFeedback Event  - With sample code

Control.DoDragDrop Method   -  With full code sample showing GiveFeedback


Author Comment

ID: 24416703

It was not exactly what I was looking for.

LVL 63

Accepted Solution

Fernando Soto earned 500 total points
ID: 24418051
From your previous post, "I can't use "GiveFeedback". How can I use it?", the two links show I posted show how to use it.

Author Closing Comment

ID: 31582345
The solution for my main question was not answered, although I receive other idea.

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Collapse and expand table in Word 2010 2 102
Set WorkSheet  not Working 9 52
custom authorization on controller action and HTML in mvc 1 45
Why use this lambda? 12 64
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question