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 General Discussion » CExtControlBar window destroy Collapse All
Subject Author Date
Shailesh Nikam Apr 3, 2007 - 6:30 AM

Hi,

I have created CExtControlBar object which has dialog box in it. On click on Ok button I want to close this control bar. Can you tell me how to close the dialog box and controlbar on click of onOk()

Regards,
Shailesh Nikam

Technical Support Apr 3, 2007 - 9:03 AM

You can use one of the following three options:

1) If you are using simple control bars (CExtControlBar)and the auto-hide feature is turned on

void CYourDialog::OnOK()
{
CExtControlBar * pBar = . . . // you should know this
      if( pBar->AutoHideModeGet() )
            pBar->AutoHideModeSet( false, false, true, false );
      else
            pBar->m_pDockSite->ShowControlBar( pBar, FALSE, FALSE );
}
2) If you are using simple bars (CExtControlBar) and if and the auto-hide feature is turned off
void CYourDialog::OnOK()
{
CExtControlBar * pBar = . . . // you should know this
      pBar->m_pDockSite->ShowControlBar( pBar, FALSE, FALSE );
}


3) If you are using dynamic control bars (CExtDynamicControlBar) controlled by the CExtDynamicBarSite
void CYourDialog::OnOK()
{
CExtDynamicControlBar * pBar = . . . // you should know this
bool bVisible = true;
CExtDynamicControlBar::eDynamicBarState_t eDBS = pBar->BarStateGet( &bVisible );
      if( bVisible )
            pBar->BarStateSet( eDBS, false );
}

Suhai Gyorgy Apr 3, 2007 - 7:42 AM

I guess you have a CFrameWnd as the main window of your application. Place this call in the OnOK of your dialog class, but do not call OnOK of base class:
    CExtControlBar::DoFrameBarCheckCmd( (CFrameWnd *)AfxGetMainWnd(), ID_VIEW_RESIZABLEBAR_DLG, true );
where ID_VIEW_RESIZABLEBAR_DLG is the ID you use when you call Create on the controlbar.