Print Page | Close Window

Hiding "Add or Remove Buttons" from expand button

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=16642
Printed Date: 01 May 2025 at 10:08am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Hiding "Add or Remove Buttons" from expand button
Posted By: lfoster
Subject: Hiding "Add or Remove Buttons" from expand button
Date Posted: 28 April 2010 at 5:35am
There was a post in the ActiveX / COM forum asking the same thing but I thought maybe the solution they were using was different as I have tried it with no success. For ref see http://forum.codejock.com/forum_posts.asp?TID=16196

They suggested using the bShowExpandButtonAlways option of the command bars but I tried this and I just get the usual expand button with the "Add or Remove Buttons" menu item.

I want to just have the expand button with nothing but the toolbar buttons that didn't fit on the toolbar itself.

Can anyone help?

Thanks,

Lewis



Replies:
Posted By: sunceenjoy
Date Posted: 07 May 2010 at 12:12am

do you mean to hide the expending menu??

 

Call this method to show/hide expand button of toolbar

void ShowExpandButton(
    BOOL bShowExpandButton
);


Posted By: elmue
Date Posted: 05 June 2010 at 7:01pm
Hello

This answer is wrong.

Like Ifoster I also want to remove the "Add or remove buttons" menu entry WITHOUT removing the icons that don't fit into the toolbar.
But
pCommandBar->ShowExpandButton(FALSE);

removes BOTH!

This is not what I want





Posted By: SuperMario
Date Posted: 07 June 2010 at 2:30pm
You can do something like this:

Private Sub CommandBars_InitCommandsPopup(ByVal CommandBar As XtremeCommandBars.ICommandBar)
    On Error Resume Next
        CommandBar.Controls.Find(, XTP_ID_CUSTOMIZE_ADDORREMOVE, , True).Visible = False
End Sub

OR if you still want the expand button displayed all the time, but don't want add\remove:

Private Sub CommandBars_InitCommandsPopup(ByVal CommandBar As XtremeCommandBars.ICommandBar)
    On Error Resume Next
        CommandBar.Controls.Find(, XTP_ID_CUSTOMIZE_ADDORREMOVE, , True).Visible = False
        If Not CommandBar.Controls.Find(, XTP_ID_CUSTOMIZE_ADDORREMOVE, , True).Visible Then
            If CommandBar.Controls.Count = 1 Then
                CommandBar.Controls.Add xtpControlLabel, 1234, "No Options Available", , True
            End If
        End If
End Sub


Posted By: SuperMario
Date Posted: 07 June 2010 at 2:38pm
You need something like this for MFC version (untested code)

BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
...
    ON_XTP_INITCOMMANDSPOPUP()
...
END_MESSAGE_MAP()
...
afx_msg void OnInitCommandsPopup(CXTPPopupBar* pComandBar);
...
void CMainFrame::OnInitCommandsPopup(CXTPPopupBar* pCommandBar)
{
    // get the list of commands for the popup.
    CXTPControls* pCommandList = pCommandBar->GetControls();

    // Remove "Add\Remove" menu item from the File menu.
    CXTPControl* pCommandNew = pCommandList->FindControl(
        xtpControlButton, XTP_ID_CUSTOMIZE_ADDORREMOVE, TRUE, FALSE);
    if (pCommandNew)
    {
        pCommandList->Remove(pCommandNew);
    }
}




Posted By: elmue
Date Posted: 08 June 2010 at 12:11am
Have a look for a more detailed discussion of this topic in this manual:
http://forum.codejock.com/forum_posts.asp?TID=16791 - How to create a fixed toolbar



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net