![]() |
Adding toolbar button dynamically |
Post Reply
|
| Author | |
sabapathy
Newbie
Joined: 12 November 2009 Location: India Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: Adding toolbar button dynamicallyPosted: 29 May 2010 at 2:38am |
|
I would like to add a button dynamically in the toolbar of my SDI application.
The toolbar type is CXTPToolBar.
How can do it and specify the style & type of control.
Thanks
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 May 2010 at 3:14am |
|
Hi,
just pToolBar->GetControls()->Add(xtpControlButton, ...); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
FrankC
Groupie
Joined: 04 September 2008 Location: United States Status: Offline Points: 35 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 May 2011 at 4:33pm |
|
Thanks Oleg. According to your suggestion, I have tried the following code when creating the mainframe menubar. However, the added button does not show up. Do you think these code are correct? Thanks, Frank CXTPCommandBars* pCommandBars = GetCommandBars(); CXTPMenuBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME); CXTPControls* pzMenuControls = pMenuBar->GetControls(); CXTPControl* pNewControl = pzMenuControls->Add(xtpControlButton, 100, "Manage"); DWORD dwFlags = pNewControl->GetFlags(); dwFlags |= xtpFlagRightAlign; pNewControl->SetFlags(dwFlags); pNewControl->SetVisible(TRUE);
|
|
![]() |
|
FrankC
Groupie
Joined: 04 September 2008 Location: United States Status: Offline Points: 35 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 May 2011 at 5:58pm |
|
Solved.
I have to clean the previously saved menu settings. Thanks, Frank
|
|
![]() |
|
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 |