Key events stopped working?

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?
 
S

Sam Marrocco

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.
 
C

Cor Ligthert

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..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top