CToolBar Button Flickers. [modified]
-
Hi All, I am getting flicker when Disable the CToolBar Buttons when ON_UPDATE_COMMAND_UI message with CmdUI->Enable(FALSE) twice depending on some condition. But everytime I move my mouse the grayed-out button flickers. Un-grayed buttons do not flicker. Any Prolem whith this. Code ------- void CMainFrame::OnUpdateFileDeleteplans(CCmdUI* pCmdUI) { bool bExecuteSQLWin = false; if(bExecuteSQLWin) pCmdUI->Enable(FALSE); else pCmdUI->Enable(); pCmdUI->Enable(CheckOpenPlans()); --> Here i added with a Function CheckOpenPlans().......>==========// } bool CMainFrame::CheckOpenPlans() { CMDIChildWnd* MyWnd = NULL; MyWnd = MDIGetActive(); CView* pView = NULL; if(MyWnd != NULL) { pView = (CView*) MyWnd->GetActiveView(); if((pView->IsKindOf(RUNTIME_CLASS(CSelectQueryView)) || pView->IsKindOf(RUNTIME_CLASS(OpenPlansTreeView)))) { MyWnd = NULL; pView = NULL; return false; } else { MyWnd = NULL; pView = NULL; return true; } } return true; }
modified on Monday, December 20, 2010 12:29 AM