Hiding DialogBar of Mainframe [Solved]
-
HI, In my application im having one Dialogbar contains Listbox and editbox and i attached this DialogBar to Mainframe. But i want to display this DialogBar only when some childviews are active.Otherwise this DialgoBar should be in hiding.TO get this in OnTImer() of Mainframe class.I did this..
void CMainFrame::OnTimer(UINT_PTR nIDEvent)
{
CMDIFrameWnd *pMainWnd = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd ;
CMDIChildWnd *fChWnd = (CMDIChildWnd*)pMainWnd->GetActiveFrame();
CView *pView = (CView*)fChWnd->GetActiveView ();if(NULL != pView) { if(pView->IsKindOf(RUNTIME\_CLASS(CGraphView))) m\_RecentAlarms.ShowWindow(SW\_SHOW); else m\_RecentAlarms.ShowWindow(SW\_HIDE); } m\_RecentAlarms.Invalidate(); CMDIFrameWnd::OnTimer(nIDEvent);
}
m_RecentAlarms is DialogBar. It works for one time only.First when i go to CTuningView(I dont want dialogbar),the dialogbar gets hided.When i go to CGraphView,it shows. But when again go to tuning view its not get hided.When i debug,the cursor goes to OnTimer() and it goes to SW_HIDE also..but even its showing here. Pls help me in this issue.
Anu
modified on Friday, August 12, 2011 5:28 AM
-
HI, In my application im having one Dialogbar contains Listbox and editbox and i attached this DialogBar to Mainframe. But i want to display this DialogBar only when some childviews are active.Otherwise this DialgoBar should be in hiding.TO get this in OnTImer() of Mainframe class.I did this..
void CMainFrame::OnTimer(UINT_PTR nIDEvent)
{
CMDIFrameWnd *pMainWnd = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd ;
CMDIChildWnd *fChWnd = (CMDIChildWnd*)pMainWnd->GetActiveFrame();
CView *pView = (CView*)fChWnd->GetActiveView ();if(NULL != pView) { if(pView->IsKindOf(RUNTIME\_CLASS(CGraphView))) m\_RecentAlarms.ShowWindow(SW\_SHOW); else m\_RecentAlarms.ShowWindow(SW\_HIDE); } m\_RecentAlarms.Invalidate(); CMDIFrameWnd::OnTimer(nIDEvent);
}
m_RecentAlarms is DialogBar. It works for one time only.First when i go to CTuningView(I dont want dialogbar),the dialogbar gets hided.When i go to CGraphView,it shows. But when again go to tuning view its not get hided.When i debug,the cursor goes to OnTimer() and it goes to SW_HIDE also..but even its showing here. Pls help me in this issue.
Anu
modified on Friday, August 12, 2011 5:28 AM
Try Using ShowcontrolBar to show\hide the controlbar.
-
Try Using ShowcontrolBar to show\hide the controlbar.