Solved

mouse down, up, click

Posted on 2011-09-14
10
354 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
Comment Utility
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
Comment Utility
0
 

Expert Comment

by:khurram_adill
Comment Utility
mouse_click event is fired when you press the mouse button and release it.
0
 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 125 total points
Comment Utility
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
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 3

Author Closing Comment

by:Mutsop
Comment Utility
Thanks clear answers :)
0
 
LVL 5

Expert Comment

by:speak2ab
Comment Utility
Glad i could help.
0
 
LVL 40

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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
Comment Utility
@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

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
asp.net mvc5 3 35
C# code editing and collaboration 3 38
.net Multiple Row Form Fields Data Entry 4 15
Round up to 100% in .NET 10 38
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now