How to move a panel using keyboard input?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Consanguinity
    New Member
    • Mar 2010
    • 1

    How to move a panel using keyboard input?

    The title may not really identify what I'm trying to do, so I'll provide a screenshot.

    What I'm trying to do is a design an RPG style combat system using VB. If I can get the interface working, the bulk of the internal coding shouldn't be a problem but what I'd like to know is:

    As you can see, there is a panel on the "Attack" command in the screenshot. I'd like to know if there is some way to make it so that, while the program is running, when the user presses the up or down arrow keys, the panel moves thirty spaces to the appropriate selection. And once highlighting the desired choice, how could I use the enter key to activate the function of those labels?

    For example, if the user highlights "Apocalypti c Power" and presses Enter, I want it to bring up and make visible a hidden panel displaying all of the powers available. And from there, pressing enter on the appropriate power will bring up the Enemy Target screen, and upon selecting the target, will initiate the damage function.

    I just need help figuring out the keyboard related code, I haven't worked with it prior to this.

    Edit: The sprites in the screenshot are just placeholders until my graphic designer gets around to making the actual graphics.
    Attached Files
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    Use one of the KeyDown, KeyPress, KeyUp event of the control that has focus to determine what is being pressed and take action from there... Or you could use your friends (yahoo, google, ask, answers, bing) to search for vb6 keyboard hook...



    Good Luck

    Comment

    Working...