Clicking a command button similates pressing a keyboard button?
Hi there folks!
I am working on a prog, and right now, you can use the left and right arrows to move. But I would like to have a couple of command buttons on the form that could mimic pressing them.
Would anyone know of a way to do that?
Thanks!
Re: Clicking a command button similates pressing a keyboard button?
> "... you can use the left and right arrows to move."
"Move" within what sort of Control?
Within a TextBox, you'd change the TextBox's SelStart position.
Within a Grid, you'd change the Col[umn] property (depends which Grid you use).
Regards, Phill W.
Re: Clicking a command button similates pressing a keyboard button?
It depends on how you have coded what you have done so far. If you did it the preferred way. {created a sub or subs for the movements and call them from a key down/up or press event} Then you simply call the related sub from the button click as desired.
If you placed all of the code in the key down/up or press event then you would likely need to duplicate that code for the movement in the button click event or change your code to use subs as mentioned above and then call those from the areas needed.
It would have helped if you would have shared some related code so we could have a better idea what you are talking about.