Results 1 to 3 of 3

Thread: Clicking a command button similates pressing a keyboard button?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Posts
    2,295

    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!

  2. #2
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    813

    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.

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width