Solved

Click x MouseDown

Posted on 2009-05-17
8
170 Views
Last Modified: 2012-05-07
Hello,

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 Vb.net, but, MouseDown could be a "drag" event instead of click event. Is there a way to isolate both?

Thank you
0
Comment
Question by:jr_barros_jr
[X]
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
8 Comments
 
LVL 5

Expert Comment

by:karstieman
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.
0
 

Author Comment

by:jr_barros_jr
ID: 24405908
Karstieman,

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".

0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 24406517
Hi jr_barros_jr;

From Microsoft documentation: Implementing Drag and Drop in Visual Basic .NET
http://msdn.microsoft.com/en-us/library/aa289508(VS.71).aspx

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

Fernando
0
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

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

Expert Comment

by:Fernando Soto
ID: 24406698
Hi r_barros_jr;

Control.GiveFeedback Event  - With sample code
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.givefeedback.aspx

Control.DoDragDrop Method   -  With full code sample showing GiveFeedback
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dodragdrop.aspx

Fernando
0
 

Author Comment

by:jr_barros_jr
ID: 24416703
Fernando,

It was not exactly what I was looking for.


0
 
LVL 63

Accepted Solution

by:
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.
0
 

Author Closing Comment

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

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 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