Catching Uparrow Keypress 
Author Message
 Catching Uparrow Keypress

Hi,
I've a problem with a form.
Is there a way to trap a keypress when a user is in a combo box.
I can pick up all the normal Character 1-0, A-Z & a-z etc,
But I can't trap codes like Up arrow, down Arrow, Insert, Delete etc.

Any ideas how to do this.

TIA
Darren



Tue, 12 Sep 2000 03:00:00 GMT  
 Catching Uparrow Keypress



Quote:
> Is there a way to trap a keypress when a user is in a combo box.
> I can pick up all the normal Character 1-0, A-Z & a-z etc,
> But I can't trap codes like Up arrow, down Arrow, Insert, Delete etc.

To trap those keystrokes, you must use the KeyDown or KeyUp event
procedures. KeyPress only traps "typeable" keys. -- ken


Tue, 12 Sep 2000 03:00:00 GMT  
 Catching Uparrow Keypress

Hi Darren,

Use the OnKeyDown event procedure.

Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode

Case 38, 40, 33, 34, 45, 46
'KeyCodes for UpArrow, DownArrow, PgUp, PgDn, Insert, Delete

Keycode = 0
'This means ignore the keystroke completely ...

Case Else
KeyCode = KeyCode
'Let any other keystrokes pass thru

End Select

End Sub

Quote:
> I've a problem with a form.
> Is there a way to trap a keypress when a user is in a combo box.
> I can pick up all the normal Character 1-0, A-Z & a-z etc,
> But I can't trap codes like Up arrow, down Arrow, Insert, Delete etc.



Wed, 13 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How can I catch a keypress-event?

2. catch the keypress-event to delete records

3. Outlook catches keypress

4. In vbs exist the keypress event

5. Keypress event

6. Disabling shift keypress that prevents code execution

7. Keypress Counter

8. Capture keypress

9. Exit Loop on keypress?

10. Keypress


 
Powered by phpBB® Forum Software © phpBB Group