Solved

mouse down, up, click

Posted on 2011-09-14
10
359 Views
Last Modified: 2012-05-12
Hi,

when does the mouse_click event fire?
is it at mouse up? down? what happens when you press the button and release after moving the mouse?

0
Comment
Question by:Mutsop
[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
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 15

Expert Comment

by:Minh Võ Công
ID: 36534524
when press the button of mousse the even: Mouse down, mouse up, then mouse click fire.
0
 
LVL 15

Assisted Solution

by:Minh Võ Công
Minh Võ Công earned 125 total points
ID: 36534549
0
 

Expert Comment

by:khurram_adill
ID: 36534560
mouse_click event is fired when you press the mouse button and release it.
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 125 total points
ID: 36534890
MouseClick fires after MouseDown and MouseUp, as long as the cursor has not moved too much in between.

Note that it is possible to receive a MouseUp and a MouseDown but now MouseClick. If the user press down on the button over a control but releases it over another one, the first will receive only a MouseDown, the second will receive only a MouseUp, but none will receive a MouseClick.

This is why MouseClick is the best one to use in most cases. It makes sure that the user really intended to click on the button and was not simply cancelling an error.
0
 
LVL 5

Accepted Solution

by:
speak2ab earned 250 total points
ID: 36534913
These are some events you can fire with a mouse in .net

MouseDown: This event happens when the mouse pointer is over the form/control and is pressed
MouseEnter: This event happens when the mouse pointer enters the form/control
MouseUp: This event happens when the mouse pointer is over the form/control and the mouse button is released
MouseLeave: This event happens when the mouse pointer leaves the form/control
MouseMove: This event happens when the mouse pointer is moved over the form/control
MouseWheel: This event happens when the mouse wheel moves while the form/control has focus
MouseHover: This event happens when the mouse pointer hovers over the form/control

If you check this site you will see an example that illustrates how to handle mouse events -
http://www.startvbdotnet.com/forms/mouse.aspx

For your last question, "what happens when you press the button and release after moving the mouse?" In principle you have activated: 1. the MouseDown. 2. MouseMove and 3. The mouse up.

Hope this helps you to understand what goes on?
0
 
LVL 3

Author Closing Comment

by:Mutsop
ID: 36535144
Thanks clear answers :)
0
 
LVL 5

Expert Comment

by:speak2ab
ID: 36535408
Glad i could help.
0
 
LVL 40
ID: 36536562
Strange.

The question was about MouseClick and the answer that was selected for a solution did not even mention MouseClick.

Might be my reading glasses.
0
 
LVL 3

Author Comment

by:Mutsop
ID: 36539040
@JamesBurger: I suppose it's your reading glasses, as there are 2 main questions.
1. when does the click event trigger
2.  what happens when you press the button and release after moving the mouse?
0
 
LVL 40
ID: 36539635
This answered both questions:

MouseClick fires after MouseDown and MouseUp, as long as the cursor has not moved too much in between.

Note that it is possible to receive a MouseUp and a MouseDown but now MouseClick. If the user press down on the button over a control but releases it over another one, the first will receive only a MouseDown, the second will receive only a MouseUp, but none will receive a MouseClick.

This is why MouseClick is the best one to use in most cases. It makes sure that the user really intended to click on the button and was not simply cancelling an error.


Speak2ab answered only the second one :-)
0

Featured Post

Independent Software Vendors: 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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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