Key events stopped working?

  • Thread starter Thread starter Sam Marrocco
  • Start date Start date
S

Sam Marrocco

Is it normal activity for the keypress events of a form to stop working
when button controls are on the form? I have a situation where a form
that behaves normally, is capable of sending KeyPress, KeyUp & KeyDown
events ONLY when there are no button controls on the form. If the
control is deleted, the events will again fire normally.

Is this a normal behavior, or does anyone have an idea why it would happen?
 
Well, for once I answered my own question. It *is* the normal behavior,
and to still get keypress events you must enable the KeyPreview=true
property of the form.
 
Sam found its own answer, this to prevent from constantly opening because
somebody thinks the result message was an addition to the question and there
was no answer yet..
 
Back
Top