Click to See Complete Forum and Search --> : see what key was pressed


jason213123
March 21st, 2010, 05:20 PM
hi,
i have a pocket pc that have some special keys
and i need detect when a key is pressed in my program.
how can i detect the keys that is pressed?
i have tested in a textbox change function
the box detect all keys except that special keys
there is some api to look for alk keys thatīs is pressed
in pocket pc?
thanks a lot for your help
:)

DataMiser
March 21st, 2010, 05:36 PM
One of the easiest ways is to set the forms keypreview property to true
Then in form keypress you can see which key is pressed.

You can also do this in a controls keypress event.

This works for the more common keys. in some cases you may need to use the keydown event instead.

DataMiser
March 21st, 2010, 05:37 PM
Do not use the changed event for this as this event can fire when no key has been pressed and can lead to errors in your program.

jason213123
March 22nd, 2010, 07:37 AM
hi,
thanks for your help

i have done that of the forms key pressed and that works perfect for what i need!
thanks a lot for your help :)