FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Accelerator keys for buttons ? (SOLVED)
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Accelerator keys for buttons ? (SOLVED)
Posted: Wed Nov 26, 2008 08:21 AM

Can a button be activated via a keyboard shortcut instead via mouse ? For example: Alt-N (next). Thank you.

Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Accelerator keys for buttons ? (SOLVED)
Posted: Wed Nov 26, 2008 08:51 AM
Hi,

If you are not talking about the buttons used in the Dialogs, Yes you can
use '&' before the character which you want to use with Alt combination
as under.

Through Code :

@ 15,15  BUTTON "&Next" SIZE 35, 12 ;
              ACTION MsgInfo( "Any action here!" ) DEFAULT

or

Through Resources :

REDEFINE BUTTON PROMPT "&Next" ID 120 OF oDlg 
               ACTION oPags:GoPrev()


But you can't use keyboard for the buttons used in the toolbar. You have
to use mouse to select them.

Regards,

- Ramesh Babu P


[/code]
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Accelerator keys for buttons ? (SOLVED)
Posted: Wed Nov 26, 2008 04:00 PM

Rameshbabu:

Thank you for the tip, but I need it for a dialog button.

Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Accelerator keys for buttons ? (SOLVED)
Posted: Sun Nov 30, 2008 03:56 AM
Hi,

>>but I need it for a dialog button.


I did not understand what you mean. Can you pelease show me the
code.

Regards,

- Ramesh Babu P
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Accelerator keys for buttons ? (SOLVED)
Posted: Sun Nov 30, 2008 10:12 AM
Hi,

To my opinion you can only use keyboard shortcuts in button if you are using plain text in the button (e.g. "&Next").

If you are using bitmaps into your buttons, you can only use specials keys (function keys, insert, delete, etc.) to be connected to your button.

You can do this by using :
SET KEY VK_NEXT TO Your_Function".

Good luck.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Accelerator keys for buttons ? (SOLVED)
Posted: Mon Dec 01, 2008 05:15 AM

Thank you guys, problem solved with the &. 8)

Continue the discussion