In C#, can i create an event handler based on how long a user holds a mouse button?
-
-- PREFACE -- I am new to programmig :) -- I want to create an event handler based on how long a user presses and holds down a mouse button. When a user holds down a mouse button for 1.5seconds, on any file, the file would open and/or is read using something like File.ReadAllBytes. Is this possible in C#? Thanks!
-
Answer:
In the MouseDown event, record the system time. In the MouseUp event, compare the current time to the recorded system time to see how long the mouse was down for. Use that to determine what to do (which method to call, etc.)
Luke at Yahoo! Answers Visit the source
Related Q & A:
- How can i create a mobile application server?Best solution by Stack Overflow
- How can i create a new blog?Best solution by Yahoo! Answers
- How can I create a new font?Best solution by Yahoo! Answers
- How Can I Create an XML to Create a Menu?Best solution by Drupal Answers
- Can I grow an orchid from seed and how long would it take?Best solution by users.on.net
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.