?
Solved

mouse down, up, click

Posted on 2011-09-14
10
Medium Priority
?
361 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 500 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 500 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 1000 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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

762 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