PDA

View Full Version : Solved: Button click event: Mouse click X alt-key



MK_
03-05-2011, 03:25 PM
Hi All,

Is there a way to distinguish between the mouse click and the accelerator key press when a button click event is triggered?

Thanks in advance,
MK

Frosty
03-05-2011, 07:00 PM
At what point? On a userform? Yes. There are events which differentiate between (for example) cmdOK_Click and cmdOK_MouseDown.

On an activecontrol (i.e., clicking the Bold button in word native)? I'm not sure, but I don't think so. I think you get the control after those two events fire.

Want to give a little more info as well as what versions of Word you're working in... '97 works a little differently than 2010 with regards to events.

MK_
03-07-2011, 07:47 AM
Hi Frosty,

I´m using MS Word 2003.
I need to know if a "click routine" is called by clicking a button on a userform or pressing it´s correspondent accelerator key.
Maybe flaging a var at the mousedown event?

Thanks

Frosty
03-07-2011, 09:13 AM
I believe the answer is you'll get multiple. Just create all of them (on your custom userform) and put msgbox in each to learn the order. Click isn't the only event available to you.

MK_
03-09-2011, 01:41 PM
Thanks Frosty,

I got what I need using a flag in the mousedown event to distinguish when the click routine is called by the "click" or by the "key".

RonMcK
03-14-2011, 02:35 PM
MK,

Since you have apparently reached a solution, how about marking your query Solved? Look at Thread Tools.

Cheers