Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Un-removing a button from the toolbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Un-removing a button from the toolbar

 Post Reply Post Reply
Author
Message
tralfaz View Drop Down
Groupie
Groupie


Joined: 21 June 2009
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote tralfaz Quote  Post ReplyReply Direct Link To This Post Topic: Un-removing a button from the toolbar
    Posted: 07 August 2009 at 6:18pm
If a button has been pulled off a toolbar, what function do I call to get it back. I tried these:

pControl->SetHideFlag(XTPControlHideFlags:::xtpNoHide, true);
pControl->SetVisible(true);

neither of them brought back the button.

Thanks


XP Pro SP3 / VS2008 C++ / Xtreme CommandBars v13.1.0
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 August 2009 at 3:22am
Hi,
 
By "pulled off" you mean moved by user during cutsomization ? if so you have add it again with Add method.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
tralfaz View Drop Down
Groupie
Groupie


Joined: 21 June 2009
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote tralfaz Quote  Post ReplyReply Direct Link To This Post Posted: 10 August 2009 at 11:14am
Yes, pulled off by the user in Customize mode.

It's interesting that the button item is still part of the toolbar, but not visible. Why do I need to add it? Can't I flip a switch?

XP Pro SP3 / VS2008 C++ / Xtreme CommandBars v13.1.0
Back to Top
tralfaz View Drop Down
Groupie
Groupie


Joined: 21 June 2009
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote tralfaz Quote  Post ReplyReply Direct Link To This Post Posted: 10 August 2009 at 3:04pm
There is no Add method for the CXTPToolbar class. Perhaps you are confused. I want to make "pulled off" button visible again on a toolbar

Can you post some code?

XP Pro SP3 / VS2008 C++ / Xtreme CommandBars v13.1.0
Back to Top
tralfaz View Drop Down
Groupie
Groupie


Joined: 21 June 2009
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote tralfaz Quote  Post ReplyReply Direct Link To This Post Posted: 10 August 2009 at 5:50pm
Got it to work.

    CXTPToolBar* pTBar = pCommandBars->GetToolBar(IDR_CUSTOM_TOOLBAR);
    if (pTBar) {
        CXTPControls* pControls = pTBar->GetControls();
         pControls->Add(XTPControlType::xtpControlButton, nID,  ButtonText, nPos);
    }

XP Pro SP3 / VS2008 C++ / Xtreme CommandBars v13.1.0
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.