Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to process a keypress for whole form & all controls 2

Status
Not open for further replies.

biot023

Programmer
Nov 8, 2001
403
GB
Hallo.
Does anyone know a way to set an event for a keypress that would apply to everything on a form? So far, I've always had to write an event handler for every control that can receive focus if I've wanted a certain kep press to trigger something, but I can't help feeling that there must be a more efficient way of coding this.
Only I'm b*ggered if I can find it.
Any & all help gratefully received,
Douglas JL

Common sense is what tells you the world is flat.
 
hi Douglas,

Have a look at the forms KeyPreview property.

best of luck,
Hennie
 
Brilliant! You've just significantly reduced the stress in my life!
Thanks again for your help,
Douglas JL

Common sense is what tells you the world is flat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top