"iwdu15" <iw****@discuss ions.microsoft. com> schrieb:
hi, i was wondering how i can create hotkeys for my form? like if it
involves
a select case for the keydown event
The solution depends on what you consider to be a hotkey.
You can assign keyboard accelerators to various Windows Forms controly by
preceeding a character of their captions (property 'Text') with the "&"
character. If "&Start" is assigned to a button's caption, the user can
press Alt+S to raise the button's 'Click' event.
Another method to provide keyboard accelerators is using a menu bar
(MainMenu component). Each menu item has a 'Shortcut' property. If the
shortcut gets pressed, the according menu item's 'Click' event handler is
invoked. When using this approach the menu items do not even need to be
visible in order to make the shortcuts work.
The third alternative is to set the form's 'KeyPreview' property to 'True'
and handle the form's 'KeyDown'/'KeyUp' events.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>