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 |
|
MARK ROBERTS
|
Jul 15, 2004 - 1:46 PM
|
Is it possible to have a maximize/ minimize button in a CExtControlBar window. My current requirement is to allow CExtControlbar to be maximize and fit to the whole parent window, similar to an MDIChild. and if I minimize will restore to last position it was in whether it was floating or docked.
|
|
Technical Support
|
Jul 16, 2004 - 1:12 PM
|
Dear Mark,
Please take a look at the CExtControlBar::OnNcAreaButtonsReinitialize virtual method in the ExtControlBar.cpp file: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 CExtBarNcAreaButtonExpand(this) );
NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
} The commented line inserts the minimize/maximize button to the resizable bar’s caption. So, create a CExtControlBar -derived class and override this method (you need to uncomment this line).
|
|
Saroj Acharya
|
Aug 19, 2004 - 3:55 PM
|
Does this method really work ? I tried this and I did not get the Min/Max button in my CExtControlBar window. Please see the following code(mine): void CImageCaptureWndView::OnNcAreaButtonsReinitialize() { CExtControlBar::OnNcAreaButtonsReinitialize(); NcButtons_Add( new CExtBarNcAreaButtonExpand(this) ); }
|
|
Technical Support
|
Aug 20, 2004 - 12:50 PM
|
Dear Saroj,
It seems your source code should look like this:
void CImageCaptureWndView::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 CExtBarNcAreaButtonExpand(this) );
NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
}
|
|