Hiding "Add or Remove Buttons" from expand button |
Post Reply |
Author | |
lfoster
Groupie Joined: 26 April 2010 Status: Offline Points: 11 |
Post Options
Thanks(0)
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 |
|
sunceenjoy
Groupie Joined: 16 April 2010 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
|
elmue
Groupie Joined: 05 June 2010 Location: Germany Status: Offline Points: 24 |
Post Options
Thanks(0)
|
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 |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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 |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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); } } |
|
elmue
Groupie Joined: 05 June 2010 Location: Germany Status: Offline Points: 24 |
Post Options
Thanks(0)
|
Have a look for a more detailed discussion of this topic in this manual:
How to create a fixed toolbar |
|
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 |