how can my winform receive keyboard events?

A

assaf

hi all

i want my winform to receive keyboard events.
however, when i add input controls to my winform
(such as a button),
my winform stops receiving keyboard events.

how can my winform receive keyboard events?


assaf
 
H

Herfried K. Wagner [MVP]

assaf said:
i want my winform to receive keyboard events.
however, when i add input controls to my winform
(such as a button),
my winform stops receiving keyboard events.

Set the form's 'KeyPreview' property to 'True' and add a handler to the
form's 'KeyDown'/... event(s).
 

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

Top