Professional UI Solutions
Site Map   /  Register
 
 

Forum

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 Tech Support » How to remove the close button from CExtControlBar Collapse All
Subject Author Date
Rajneesh May 9, 2003 - 5:29 AM

Ho do i remove the close button from my docking windows derived from CExtControlBar. Also please tell the functionality of the control button, does it closes the window or simply hides it.

Customer Support Team May 13, 2003 - 1:25 PM

You should use your own class derived from CextControlBar ( or CExtToolControlBar, or CExtMenuControlBar ) and override the OnNcAreaButtonsReinitialize() virtual method.

This is the source code of CExtControlBar::OnNcAreaButtonsReinitialize():

void CExtControlBar::OnNcAreaButtonsReinitialize()
{
INT nCountOfNcButtons = NcButtons_GetCount();
if( nCountOfNcButtons > 0 )
return;
NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
}

If yop remove this line
NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
the "X" button will disappear.

When the control bar window is in the floating state, it is inside a miniframe window which is created and destroyed automatically by Prof-UIS. The "X" on this frame just hides the window.

All the non-client area buttons are instances of the classes which are derived from CExtBarNcAreaButton. You can write your own buttons and initialize them in OnNcAreaButtonsReinitialize().

Please feel free to contact us if you have any problems.