Click to See Complete Forum and Search --> : General KeyDown


OrenKul
May 3rd, 2001, 05:36 AM
Hi !

How do you make a funcion respond to a ceratin key (say 'D') without relation to what control has got the focus ?
I mean - without using the different controls\forms KeyDown events.

Thanks,

Oren.


~&-)

Cimperiali
May 3rd, 2001, 05:41 AM
set the keypreview property of a form to true
The form will receive the keystroke before controls
Then you can code calls to subs or functions in keypress, keydown, keyup events of the form

Special thanks to Lothar "the Great" Haensler, Tom Archer, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.