Board index » cppbuilder » Assign Shortcut key to Button
Eugene
![]() CBuilder Developer |
Eugene
![]() CBuilder Developer |
Assign Shortcut key to Button2004-09-01 01:47:19 AM cppbuilder102 Dear All, I would like to assign shortcut key to TButton control.But i don't want to make this with "&" character.Like "Caption" to "&Caption" with ALT+C.Could i make this like CTRL+ALT+Key? Thanks in Advance Eugene |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2004-09-01 02:50:48 AM
Re:Assign Shortcut key to Button
"Eugene" < XXXX@XXXXX.COM >wrote in message
QuoteI would like to assign shortcut key to TButton control.But With that said, look at the RegisterHotKey() function in the Win32 API. Then have your code catch WM_HOTKEY messages. When you receive a WM_HOTKEY message, you can call your button's Click() method. Alternatively, set your form's KeyPreview property to true and then use its OnKey... events to catch the hotkey manually. Gambit |
Eugene
![]() CBuilder Developer |
2004-09-01 02:28:17 PM
Re:Assign Shortcut key to Button
Hi Remy,
I solved my problem with KeyPreview+OnKeyDown+VK_F2 combination Thank you for your great clue. Eugene "Remy Lebeau \(TeamB\)" < XXXX@XXXXX.COM >wrote: Quote
{smallsort} |