shortcut on text-less button
-
Hi. I've got a button with no text (only and icon) and I need a shortcut key (accelerator key) to the button. Normally i would do something like "Cl&ose" to use the "o" as a shortcut, but my button has no text, so how do i accimplish this?:|
-
Hi. I've got a button with no text (only and icon) and I need a shortcut key (accelerator key) to the button. Normally i would do something like "Cl&ose" to use the "o" as a shortcut, but my button has no text, so how do i accimplish this?:|
Set
KeyPreview
totrue
on yourForm
that contains the button and handle theKeyDown
orKeyUp
event, which will give you the active modifier keys (Alt, Ctrl, and/or Shift) and the key that was pressed in aKeyEventArgs
passed to the event handler.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----