Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Multiple keybindings for one ID
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Multiple keybindings for one ID

 Post Reply Post Reply
Author
Message
Spyder View Drop Down
Newbie
Newbie


Joined: 17 November 2004
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Spyder Quote  Post ReplyReply Direct Link To This Post Topic: Multiple keybindings for one ID
    Posted: 12 December 2004 at 9:57pm
I have two keybindings for my "find" button, Ctrl+F and F3. No matter which order I register them, F3 always comes up in the menu as the shortcut key - but I would prefer to show Ctrl+F.

Is there any way to force this to happen?
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2004 at 6:47pm

Use the 'ShortcutText' property of the control.  This will set the text that is displayed to indicate the shortcut that will fire the command.

This technique can only be used if you don't allow customization of your commands by the end user.  Otherwise, they may change the setting (and Codejock doesn't provide any interface to know which keybindings are mapped to which commands).

Back to Top
Spyder View Drop Down
Newbie
Newbie


Joined: 17 November 2004
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Spyder Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2004 at 7:35pm
I'll try that, but according to the docs:

"This property is obsolete and is not used anymore"
Back to Top
Spyder View Drop Down
Newbie
Newbie


Joined: 17 November 2004
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Spyder Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2004 at 7:53pm
OK, that worked inside the menu but not for the tooltip. A decent enough workaround for now...
Back to Top
nighthawk View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 June 2004
Status: Offline
Points: 167
Post Options Post Options   Thanks (0) Thanks(0)   Quote nighthawk Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2004 at 12:31am
Another workaround would be to create two "find" menu items each with their own keybinding.  Make the F3 menu item invisible.  In the execute function, just duplicate the code for the two menu items or have one menu item call the execute function again with the CommandBarControl of the other menu item.  I do this when I have two menu items that do the same thing.
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2004 at 7:59am
Originally posted by Spyder Spyder wrote:

"This property is obsolete and is not used anymore"
They restored (or altered) the functionality in one version not too long ago to serve this purpose.  They never updated the documentation.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.