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.
Subject |
Author |
Date |
|
Shailesh Nikam
|
Apr 23, 2007 - 7:52 AM
|
Hi,
In my application I have created 2 controlbars. I have used below code to enable autohide feature for controlbar. But I want autohide feature to be enabled for only one controlbar. And other controlbar should have only close button. How to achieve this thing.
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS) if( ! CExtControlBar::FrameInjectAutoHideAreas(this) ) { ASSERT( FALSE ); return -1; } #endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
|
|
Technical Support
|
Apr 23, 2007 - 10:07 AM
|
Try this code: class CMyNonAutoHideAbleControlBar : public CExtControlBar
{
public:
virtual void OnNcAreaButtonsReinitialize()
{
ASSERT_VALID( this );
INT nCountOfNcButtons = NcButtons_GetCount();
if( nCountOfNcButtons > 0 )
return;
NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
}
virtual bool _CanDockToTabbedContainers(
CExtControlBar * pDestBar
) const
{
ASSERT_VALID( this );
pDestBar;
return false;
}
}; The CMyNonAutoHideAbleControlBar bar will have no pin button in its caption when it is docked inside the main frame window and, as a result, you will not be able to auto-hide it. Additionally, you will not be able to dock both bars into the same tabbed group. This is needed so that both bars cannot be switched into the auto-hidden state at once.
|
|