Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

mouse down, up, click

Posted on 2011-09-14
10
Medium Priority
?
364 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

618 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