Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtToolControlBar buttons without text Collapse All
Subject Author Date
Roberto Manes Jan 15, 2007 - 11:40 AM

Dear Sirs

Actually I’m working with a new MDI application (Visual studio 2005 prof-uis 2.60). I cannot remember how to remove the text from any button onto the default toolbar. I know it’s stupid but I couldn’t sort it out. Please can you suggest how to solve this problem ? Thanks in advance.

Technical Support Jan 15, 2007 - 1:23 PM

The toolbar does not contain any text properties. The toolbar buttons have only command identifiers. Everything else including icons, toolbar button text, tool tip text and status tip text is stored in the command manager:

CExtToolControlBar * pToolBar = . . .
CExtBarButton * pTBB = . . .
    ASSERT( pToolBar->GetSafeHwnd() != NULL );
UINT nCmdID = pTBB->GetCmdID( false );
LPCTSTR strCommandProfileName = g_CmdManager->ProfileNameFromWnd( pToolBar->m_hWnd );
    ASSERT( strCommandProfileName != NULL && _tcslen( strCommandProfileName ) > 0 );
CExtCmdItem * pCmdItem = g_CmdManager->CmdGetPtr( strCommandProfileName, nCmdID );
    ASSERT( pCmdItem != NULL );
    // remove text from toolbar button
    pCmdItem->m_sToolbarText = _T("");
    // finally, recompute the toolbar’s layout
    if( pToolBar->m_pDockSite->GetSafeHwnd() != NULL )

Roberto Manes Jan 16, 2007 - 12:31 AM

Well but if we consider the drawcli application for instance, I can see the main toolbar which comes out only with buttons showing only icons. On the contrary my main toolbar comes out with buttons showing icons together text placed in the right side. So if I would remove the text just leaving the icons how can I do ?

Technical Support Jan 16, 2007 - 11:32 AM

Drawcli is a customizable application. So this FAQ article may be helpful:

How to display both an icon and text for a toolbar button or a menu item in a customizable application?

The article describes how to show the text. In your case, you can use __ECTN_DISPLAY_DEFAULT_STYLE instead of __ECTN_DISPLAY_TEXT_AND_IMAGE. Please note that you should reset the toolbar’s state if you serialize it to the registry to see the changes made.