Button and detect key pressed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a form with a button and when I click in this button, how I can detect the keys pressed and put this keys pressed in text property of the button.

Thanks

Silvia
 
* =?Utf-8?B?U2lsdmlh?= said:
I have a form with a button and when I click in this button, how I can detect the keys pressed and put this keys pressed in text property of the button.

Set the form's 'KeyPreview' property to 'True', add a handler to its
'KeyDown' and 'KeyUp' events and store the pressed keys for example in a
'Hashtable'. In 'KeyUp', you can remove them from the table (untested).
 
Back
Top