|
Why one flicking and the other non-flicking? The flicker happens when you use this code to attach MDIClientWnd m_MTIClientWnd.Attach(this);// disable group and when ChildFrame is maximnum, and activated by Left Button Click on the tab to switch the tab, you can see the caption frame appears and disappears In the samples of XTP, there are two different methods to solve the mdichild caption's flicking in MDI app.
method 1.Overload WindowProc to deal WM_NCPAINT, such as in demo: CommandBarsDesigner
LRESULT CChildFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { if (message == WM_NCPAINT) { // prevent caption blinking return TRUE; } return CMDIChildWnd::WindowProc(message, wParam, lParam); }
method 2.Modify mdichild initial size in PreCreateWindow, such as in demo: DrawCli
BOOL CSplitFrame::PreCreateWindow(CREATESTRUCT& cs) { // make sure view is maximum size to eliminate // flicker when switching tabs. cs.x = cs.y = 0; cs.cx = cs.cy = 32767; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs
if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; return TRUE; }
It seems that the two methods work well in each application But I try to use method 1 in DrawCli instead of meathod 2, the DrawCli still flicks. I check the MainFrm, ChildFrm, even Views. There is no code can solve the flicker. Why this happens when transplant method 1 to method 2?
|