Making a Form read keyboard input

  • Thread starter Thread starter Srin
  • Start date Start date
S

Srin

Hi,
I've been trying to write a small windows application in C#. I want the
form to read special input sequences act accordingly. For example,
<Alt><Ctrl>H should bring up the help box etc. I tried to use the
form1_keydown event, but that doesn't seem to work.

What can be done to make it work?

Thanks in advance.

--ts
 
You need to set the KeyPreview property on the form to true. This will make
it fire the Key events when it is activated.
Then you should be able to handle it as you planned.

Ciaran O'Donnell
 
Ciaran said:
You need to set the KeyPreview property on the form to true. This will make
it fire the Key events when it is activated.
Then you should be able to handle it as you planned.

Ciaran O'Donnell

Thank you Ciaran, that worked.
 

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

Back
Top