Home All Groups Group Topic Archive Search About

Detecting Mouse Click Anwhere on Form

Author
27 Feb 2007 2:51 PM
jim evans
Is there an easy way to detect a mouse click anywhere on a form,
including a menu?

jim

Author
28 Feb 2007 1:42 AM
MikeD
"jim evans" <jimsTAKEOUTne***@houston.rr.com> wrote in message
news:l9h8u2p3onrlaeoap1jvtruai66lqc2qbh@4ax.com...
> Is there an easy way to detect a mouse click anywhere on a form,
> including a menu?


Subclass the form and trap the appropriate message(s)? There are most likely
several messages you'd need to trap. See the following for all the mouse
messages:

http://msdn2.microsoft.com/en-us/library/aa927364.aspx

Menus have their own messages, for example, WM_MENUSELECT.

--
Mike
Microsoft MVP Visual Basic