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 |
|
Ladislav Prosek
|
Apr 5, 2004 - 4:35 PM
|
Hello, how do I programmatically hide a CExtControlBar (simulate clicking the x button)? Thank You LP
|
|
Technical Support
|
Apr 6, 2004 - 10:18 AM
|
Dear Ladislav,
The code below hides any resizable control bar (pBar) now matter in which state it is:
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
if( pBar->AutoHideModeGet() ){
pBar->AutoHideModeSet( false, false, true, true );
CWnd* pWnd = GetDlgItem(IDC_STATIC);
if( pWnd != NULL )
pWnd->SendMessage(WM_CANCELMODE);
}
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
ShowControlBar( pBar, FALSE, FALSE );
Please note that the CFrameWnd::ShowControlBar() method is used. The CControlBar::ShowWindow() method is not suitable here because it does not affect positions of other bars in the same frame window (i.e., the method does not recalculate the frame layout).
|
|