|
-
Apr 3rd, 2000, 06:10 PM
#1
Thread Starter
Junior Member
Hi there, this is a pretty simple problem i think being that i want to detect when an arrow key is pressed, but the system doesn't seem to register them as key presses.
I have tried putting a function in the keypress function, to output the ascii code for the last keypress, but it doesn't register when an arrow is pressed, also what do VbKeyLeft/right/up/down denote?
Thanks for any help, Piers
The early bird gets the worm, but the second mouse gets the cheese.
-
Apr 3rd, 2000, 06:16 PM
#2
Hyperactive Member
Hello Piers,
Try KeyDown
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
MsgBox Str(KeyCode) & Str(Shift)
End Sub
Good luck,
Michelle.
-
Apr 3rd, 2000, 06:18 PM
#3
Lively Member
Use the keydown event
up keycode = 38
down keycode = 40
right keycode = 39
left keycode = 37
-
Apr 3rd, 2000, 07:07 PM
#4
Thread Starter
Junior Member
erm, it seems that neither of these work..
i don't know why, but they just don't, ok the situation is that i'm using the flexgrid control and when a user moves around the grid with the arrow keys, i want to know about it..
the keypress and keydown events don't even get triggered when i press the arrow keys, they only occur when i type anything else..
Any other suggestions?
Thanks Piers.
The early bird gets the worm, but the second mouse gets the cheese.
-
Apr 3rd, 2000, 07:37 PM
#5
Addicted Member
I just did a little testing and guess what. Your right, the Arrow Keys do not register in a FlexGrid. They don't even get intercepted by the Form if you set the KeyPreview property to True! But there is good news, there are two events that are triggered whenever a cell receives focus:
SelChange and RowColChange
(raised in that order)
However, these are also called if the user clicks on a differnet cell, but this may be what you're looking for.
Ciao for now.
-
Apr 4th, 2000, 03:58 AM
#6
Thread Starter
Junior Member
Thanks for claifying that for me, i thought there my be something wrong with my machine , i've had a look at those two funcions you stated, and they look pretty useful to me, thanks.
Piers
The early bird gets the worm, but the second mouse gets the cheese.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|