Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Arrow keys
Name: browser Date: March 15, 2005 at 06:56:45 Pacific OS: XP CPU/Ram: Pentium 64 MB
Comment:
Hello, I created a program in Visual Basic 6.0 (DAO) in which I have placed all of my controls onto a picture box. I have added scroll bars to the picture box and the scroll bars work. My question is, how do I make it so that the up and down arrow keys as well as the page up and page down keys work also. Any help would be greatly appreciated. Thank you.
Name: livingdecay Date: March 15, 2005 at 10:38:15 Pacific
Reply:
Use the 'OnKeyDown' event of the PicBox. The argument 'Key' or 'Button' (cant remember which) receives the keyascii that was pressed. so...
If Key = [up key ascii num, look up in msdn] then do whatever End If
You may have to play around a bit, this is a general guideline as I haven't programmed VB for a little while and it's not installed on my PC right now.
Name: egkenny Date: March 15, 2005 at 17:30:26 Pacific
Reply:
If you look up KeyCode in VB help you are given a list of constants to use. For example:
' vbKeyUp = UP ARROW key ' vbKeyDown = DOWN ARROW key ' vbKeyPageUp = PAGE UP key ' vbKeyPageDown = PAGE DOWN key
Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer) ' If KeyCode = vbKeyUp Then Debug.Print "UP ARROW key was pressed" ElseIf KeyCode = vbKeyDown Then Debug.Print "DOWN ARROW key was pressed" ElseIf KeyCode = vbKeyPageUp Then Debug.Print "PAGE UP key was pressed" ElseIf KeyCode = vbKeyPageDown Then Debug.Print "PAGE DOWN key was pressed" End If End Sub
0
Response Number 3
Name: browser Date: March 16, 2005 at 06:07:52 Pacific
Reply:
Thanks livingdecay and egkenny, your answers were very helpful and everything works now.
Summary: Hi, I'd like to make a website where the user has the ability to use his/her arrow keys to execute a file+ (ie. file.exe -r 123, or file.exe -r 124 etc.) I was told to use PHP but I cannot find a way ...
Summary: Hi, I've been trying to get a script to somehow recognize the combination of two input keys, but have not figured out how to do it. As of now, each one of the arrows has its own function (not JS funct...
Summary: There's a menu there that says so... I recall it's in the Configuration -- Window or something. Just look it up on the menu's above (if mouse is working) or press the Alt Key after then simultaneously...