trapping for Ascii key values

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
 
G

Graham Mandeno

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top