Solved

Using Arrow Keys in VB5

Posted on 1998-08-30
2
276 Views
Last Modified: 2010-04-30
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
Comment
Question by:loopdloop
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
percosolator earned 200 total points
ID: 1431849
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
 
LVL 2

Expert Comment

by:percosolator
ID: 1431850
Oh.... if you need any more, just ask.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now