[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

MouseUp and Click - What's the difference

NadCixelsyd

6/12/2012 5:15:00 PM

When I release the mouse button, MouseUp is entered, followed immediately by Click. Is there any case where one is entered but not the other?
7 Answers

mm

6/12/2012 6:07:00 PM

0


"NadCixelsyd" <nadcixelsyd@aol.com> escribió en el mensaje
news:c6d98022-7814-49b4-86bb-ee03c9d43a0b@googlegroups.com...
> When I release the mouse button, MouseUp is entered, followed immediately
> by Click. Is there any case where one is entered but not the other?

One difference is that MouseUp is triggered even when the mouse button is
released over another form or control (or even on another application or
part of the screen) when the MouseDown happened over it.


Mike Williams

6/12/2012 6:08:00 PM

0

"NadCixelsyd" <nadcixelsyd@aol.com> wrote in message
news:c6d98022-7814-49b4-86bb-ee03c9d43a0b@googlegroups.com...
>
> When I release the mouse button, MouseUp is entered, followed
> immediately by Click. Is there any case where one is entered
> but not the other?

Yes there is, when it is recognised as a Double Click.

For a Single Click you get the sequence:

MouseDown, MouseUp, Click.

For a Double Click you get the sequence:

DoubleClick, MouseUp

You can if you wish suppress Double Clicks on a specific Window Class using
SetClassLong so that you get the sequence MouseDown, MouseUp, Click on all
clicks.

Mike


Ralph

6/12/2012 6:42:00 PM

0

On Tue, 12 Jun 2012 10:15:16 -0700 (PDT), NadCixelsyd
<nadcixelsyd@aol.com> wrote:

>When I release the mouse button, MouseUp is entered,
> followed immediately by Click. Is there any case where
>one is entered but not the other?

Yes, but not often...

This issue is a matter of where you are looking at and with what you
are catching (or viewing) the events.

At the most elementary level in the WinProc the Translation is mostly
just a MouseDown and a MouseUp. "Clicks" and "DoubleClicks" are part
of an additional translation.

It is possible in some scenarios (combination of control, O/S, and
driver) to get a Click after a MouseDown before a MouseUp, and to
actually have the control 'swallow' the MouseUp so it doesn't fire at
all (as that control's events). With some controls you can modify
"click" handling.

Note, I am not saying this is what IS happening in your case. But what
is the actual problem? What are the components involved? What is the
context?

-ralph

Larry Serflaten

6/12/2012 7:53:00 PM

0

NadCixelsyd wrote:
> When I release the mouse button, MouseUp is entered, followed immediately by Click. Is there any case where one is entered but not the other?

Yes, when you press the button down on a control and then move the mouse off the
control before releasing. In that case you get the MouseUp but no Click.

LFS

Jeff Johnson [MVP: VB]

6/12/2012 9:16:00 PM

0

"NadCixelsyd" <nadcixelsyd@aol.com> wrote in message
news:c6d98022-7814-49b4-86bb-ee03c9d43a0b@googlegroups.com...

> When I release the mouse button, MouseUp is entered, followed immediately
> by
> Click. Is there any case where one is entered but not the other?

Just to expand on other comments, you can get a MouseUp but not a Click on
the SAME control that you mouse-downed on as long as you move the mouse far
enough before releasing it. Imaging clicking down on the left side of a
button, moving your mouse to the right side, and releasing. There is a
distance (stored in the registry) of exactly how far the mouse can move
before a click will be canceled.


Mike Williams

6/12/2012 9:30:00 PM

0

"Jeff Johnson" <i.get@enough.spam> wrote in message
news:jr8bj7$gf7$1@dont-email.me...
>
> Just to expand on other comments, you can get a MouseUp but
> not a Click on the SAME control that you mouse-downed on as
> long as you move the mouse far enough before releasing it.

Also, just for completeness, if you are using a laptop that is running on
batteries and if you press the mouse down on Wednesday morning and release
it on Thursday afternoon then you will get a MouseDown but will not get
either a MouseUp or a Click ;-)

Mike



mm

6/13/2012 5:13:00 AM

0


"Mike Williams" <Mike@WhiskyAndCoke.com> escribió en el mensaje
news:jr8cbg$l97$1@dont-email.me...
> "Jeff Johnson" <i.get@enough.spam> wrote in message
> news:jr8bj7$gf7$1@dont-email.me...
>>
>> Just to expand on other comments, you can get a MouseUp but
>> not a Click on the SAME control that you mouse-downed on as
>> long as you move the mouse far enough before releasing it.
>
> Also, just for completeness, if you are using a laptop that is running on
> batteries and if you press the mouse down on Wednesday morning and release
> it on Thursday afternoon then you will get a MouseDown but will not get
> either a MouseUp or a Click ;-)

Yes, and if you press it on January and release it on December 31 (of the
same year) you'll get a happy new year message.