Function key to Press Button

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

Guest

When the user presses F12, it would be like if the user click on the
"Complete" button.

In other words, when the user presses F12, I want the code be hide my
button's "on_click" to run.
 
Mike L said:
When the user presses F12, it would be like if the user click on the
"Complete" button.

In other words, when the user presses F12, I want the code be hide my
button's "on_click" to run.

Is this WebForms or WinForms? WinForms it's easy, just set the forms
KeyPreview property to True, catch the KeyUp event for the form, check for
KeyCode F12, and then call the buttons PerformClick method :)

WebForms is a lot trickier (The way I know how to do only works in Internet
Explorer 5.0+ if I remember correctly).

HTH,
Mythran
 
Perfect. Thanks.

My app is a win form.

Mythran said:
Is this WebForms or WinForms? WinForms it's easy, just set the forms
KeyPreview property to True, catch the KeyUp event for the form, check for
KeyCode F12, and then call the buttons PerformClick method :)

WebForms is a lot trickier (The way I know how to do only works in Internet
Explorer 5.0+ if I remember correctly).

HTH,
Mythran
 

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