How to have detect key pressed as well as mouse click on command button?

  • Thread starter Thread starter Jeff0803
  • Start date Start date
J

Jeff0803

Guest
There are command buttons on the form, [OK] and [Close].

I want to make it detect key "O" for [OK] and "C" for [Close] instead of mouse click.

("O" and "C" should be underscore like [OK], [Close].

How to do this?

I can do this by KeyPreview = true from form and check the key from key_up event but want to implement by command button event/property itself to make code simple.

Continue reading...
 
Back
Top