The ESCAPE key can be trapped on a form by setting the "KeyPreview" property to true, but the user control does not have this property. Does anyone know how to trap a specific key on a user control, no matter what control on that user control has the focus?
I need this functionality so that if the user presses the ESCAPE key, I can hide the user control until it is needed later.
I'm guessing that a user control is treated exactly the same as a textbox control (or other control) in that there is no KeyPreview for those controls. I suppose I'll have to trap the ESCAPE key on the Form that contains the user control, then act accordingly, correct?
tia,
flynn
I need this functionality so that if the user presses the ESCAPE key, I can hide the user control until it is needed later.
I'm guessing that a user control is treated exactly the same as a textbox control (or other control) in that there is no KeyPreview for those controls. I suppose I'll have to trap the ESCAPE key on the Form that contains the user control, then act accordingly, correct?
tia,
flynn
Last edited: