Print Page | Close Window

Expand Button drawn wider when it should be hidden

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=14444
Printed Date: 27 February 2025 at 6:20pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Expand Button drawn wider when it should be hidden
Posted By: richards
Subject: Expand Button drawn wider when it should be hidden
Date Posted: 03 June 2009 at 10:56am

When I call pTB->ShowExpandButton(false) from the main frame's OnCreate, it works fine. If I call it from within a command handler, the ExpandButton appears as a normal size button on the toolbar. How can I hide the expand button in the context of a menu command handler?

I'm using Toolkit Pro v 13.0.0 with Microsoft Visual Studio 2008 Version 9.0.21022.8. Here's the code:


void CMainFrame::LockToolbars(bool lock)
{
     bool is_enabled = !lock;

     CXTPCommandBars *pCBs = GetCommandBars();

     pCBs->EnableCustomization(is_enabled);

     int n = pCBs->GetCount();
     for (int i=0; i<n; i++)
     {
          CXTPToolBar *pTB = pCBs->GetAt(i);

          if (pTB)
          {
               pTB->SetShowGripper(is_enabled);
               pTB->ShowExpandButton(is_enabled);
               pTB->SetCloseable(is_enabled && (pTB != m_pMenuBar));
               pTB->EnableDocking(lock ? 0 : ( xtpFlagAlignAny | xtpFlagFloating));
               pTB->Invalidate();
          }
     }

     pCBs->UpdateCommandBars();
}



Replies:
Posted By: Oleg
Date Posted: 04 June 2009 at 2:07am
Hi,

Try also manually hide it
 
pPopupExp = (CXTPControlPopup*)pToolBar->GetControls()->FindControl(XTP_ID_TOOLBAR_EXPAND);
pPopupExp->SetVisible(FALSE);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: richards
Date Posted: 04 June 2009 at 8:57am
Thanks, that works.

And thanks for a great product, by the way! This has really transformed the look and feel of my app with only a few day's effort.



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