Raising keyboard events

  • Thread starter Thread starter DC
  • Start date Start date
D

DC

Hi All,

Is there any code snippet that shows how to raise keyboard events,
for example,
simulating the KEYDOWN event on key F5.

Thanks,
DC
 
Thanks Ken.
The way I had been doing it is as follows:

Dim keyData As System.Windows.Forms.Keys
keyData = Keys.F5

Dim keyEvent As System.Windows.Forms.KeyEventArgs
keyEvent = New System.Windows.Forms.KeyEventArgs(keyData)

RaiseEvent PressKeyDown(Me, keyEvent)

What do you think of this? This works ( I have a form.keydown event
handler), but I would appreciate your comments.

Regards,
DC
 

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