• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

Using Arrow Keys in VB5

I'd like to know how to detect the user pressing the arrow keys in vb5. A little example source would be plus :). And hey, it's worth 200 points.
0
loopdloop
Asked:
loopdloop
  • 2
1 Solution
 
percosolatorCommented:
Make a new project, draw a textbox on the form, let VB name it.

Paste-in this code.

----------------------
Option Explicit
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)

    Select Case KeyCode
   
        Case vbKeyUp
            MsgBox "Up Arrow Was Pressed on Text1"
        Case vbKeyDown
            MsgBox "Down Arrow Was Pressed on Text1"
        Case vbKeyLeft
            MsgBox "Left Arrow Was Pressed on Text1"
        Case vbKeyRight
            MsgBox "Right Arrow Was Pressed on Text1"
    End Select
   
End Sub

0
 
percosolatorCommented:
Oh.... if you need any more, just ask.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now