How to catch KeyUp or KeyPress event in a modal window (ShowDialog)

B

bill

I hook up event handlers to KeyUp/KeyDown/KeyPress to a modal window.
Nothing works. It works for sure on the main form. Thanks.
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi bill,

..>I hook up event handlers to KeyUp/KeyDown/KeyPress to a modal window.
Nothing works. It works for sure on the main form.

What don't work. Is it only for particular keys or they are not called for
any key.

Did you set form's KeyPreview property to *true*?

I wrote a simple test and it was working fine for modal and modalles forms.
 

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