![]() |
Adding toolbar button dynamically |
Post Reply ![]() |
Author | |
sabapathy ![]() Newbie ![]() Joined: 12 November 2009 Location: India Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() Posted: 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 ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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 |