trapping for Ascii key values

  • Thread starter Thread starter Stacey Howard
  • Start date Start date
S

Stacey Howard

I have a form that is driven solely on ASCII key values. I have a hidden
text box which receives the key value when a key is pressed the form
performs accordingly. I can trap for most keys, but am unable to trap for
the page up and page down keys. Does anyone have ideas why and or a solution
to this.


Stacey
 
Hi Stacey

Are you using the KeyDown or KeyPress event? KeyPress will not respond to
many navigation keys, but KeyDown will. The KeyCode values you should check
for are vbKeyPageUp and vbKeyPageDown.

Note that you can also set the form's KeyPreview property and then use the
Form_KeyPress event. That way you don't have to keep the focus on your
textbox. Incidentally, if the textbox is hidden, it cannot have the focus
anyway, so how can it receive the key events?
 
Back
Top