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

Re: how can my winform receive keyboard events? by Herfried

Herfried
Tue Oct 19 12:17:03 CDT 2004

"assaf" <assafwo@hotmail.com> schrieb:
> 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).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Re: how can my winform receive keyboard events? by assaf

assaf
Tue Oct 19 14:10:49 CDT 2004

bingo



"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:#S0C19ftEHA.2864@TK2MSFTNGP09.phx.gbl...
> "assaf" <assafwo@hotmail.com> schrieb:
> > 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).
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>
>