View Full Version : button function called by a keystroke


wizcow
01-07-2002, 02:46 PM
I have ten buttons on a form.
They are numbered, 0 to 9 and they enter that number into a textbox.

Is there a way that the user can have the option to press a number key on the keyboard, or click the number button?

eg. Click the '9 button' to enter 9 into the textbox, or
press the number '9' key on the keyboard, to enter 9 into the textbox.

[This message has been edited by wizcow (edited 01-07-2002).]

BadOkie
01-07-2002, 03:28 PM
Hey Wizcow,

If you already have command buttons with 0-9 as their captions then I would think you could go into each command buttons properties and under the first tab is the caption property. Try adding an "&" in front of each buttons number.

ie change 1 to &1; 2 to &2.

See if that does what your looking for.

HTH
Badokie

BadOkie
01-07-2002, 03:29 PM
Oh yea, one more thing. This should allow the user to hold the Alt key down and then push the number they want and it should fire the code behind the command button.

wizcow
01-07-2002, 08:08 PM
BadOkie

Thanks.

Tom