473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 "Apocalyptic 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 Images
File Type: jpg Lolipocalypse Screen Shot.jpg (16.0 KB, 221 views)
Mar 17 '10 #1
1 1793
vb5prgrmr
305 Expert 100+
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
Mar 18 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dennis Schulz | last post by:
hi everybody, We have a problem with our MIDI-Synthesizer. After start of our programm the piano panel has keyboard focus. After mouse click in another panel (changing instruments) the keyboard...
7
by: pysim | last post by:
Hi, I have a couple of general requests for pointers to python examples and design advice. I'm looking for examples of MVC-based GUI controls done in python (model-view-controller). Also,...
1
by: Jay | last post by:
I need to be able to move a Panel on a windows Form at run time using the mouse. I have tried adding a MouseDown event handler to the Panel and then within the MouseDown handler adding a MouseMove...
8
by: tranky | last post by:
i hope you can help me! It's possible create a moveable panel in vb.net? Click with mouse over it and move it everywhere!?!? It's possible? thank u!
2
by: =?Utf-8?B?TXJOb2JvZHk=?= | last post by:
I am trying to find a good example of SendInput. Doing a search on google I found two, one is incomplete and vague from the start and the other I copied the code and tried running it and it was...
7
by: RADAR | last post by:
i use VC++ 6,0 and i have problems with getting keyboard system inputs and to use them to check to proceed or break the loop. for example if i want to proceed until Ctrl+z is written for input.What...
8
by: BD | last post by:
How can I duplicate the behavior of the operating system shortcut keys in my application? For example, my windows form has 5 controls (textboxes), the operating system will pickup which control...
5
by: sklett | last post by:
I know that Panel (and most of it's derivitives) don't raise keyboard events. I *really* need to catch keyboard events though so I've been googling the topic and have found quite a few...
3
by: Gandalf | last post by:
why when I try to insert gridSizer to a panel which already inside another panel the gridSizer doesn't work? this is the code: panel3= wx.Panel(self, -1, (0, 60), size=(400, 240) ,...
5
by: chazzy69 | last post by:
Hey just doing a little expirement is it possible to change the position of the mouse at runtime with .php, i.e. in the case that u want to move the mouse with a keyboard. It doesn't have to be in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.