Solved

mouse down, up, click

Posted on 2011-09-14
10
357 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
  • 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
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 …

810 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