![]() |
How to set accelerator for the button by code? |
Post Reply
|
| Author | |
Rebecca
Newbie
Joined: 17 October 2007 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: How to set accelerator for the button by code?Posted: 07 November 2007 at 1:57am |
|
How to set accelerator for the ribbon button by code,not by editing RibbonSample.rc file.
Thank you.
CXTPRibbonTab* pTabHome = pRibbonBar->AddTab(ID_TAB_HOME);
CXTPRibbonGroup* pGroupClipborad = pTabHome->AddGroup(ID_GROUP_CLIPBOARD);
pGroupClipborad->Add(xtpControlButton, ID_EDIT_COPY);
CXTPcontrol *pControl = pGroupClipborad->Add(xtpControlButton, ID_FORMAT_PAINTER);
// I want to set a accelerator for this ribbon button.
// For example."Ctrl+P" is accelerator of this ribbon button.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 November 2007 at 2:03am |
|
Hello,
pCommandBars->GetShortcutManager()->AddShortcut(..,..., ID_FORMAT_PAINTER);
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |