No flickering - help

Discussion in 'MFC' started by Melinda123, Aug 25, 2009.

  1. Melinda123

    Melinda123 New Member

    Joined:
    Jul 28, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I have tab control and two cards (dialogs) in tab control. I put my bitmap picture (from resources) in picture control on main dialog window (parent dialog) and I wanna that picture stays underneath tab control dialogs, so when I called next handler (on change tab cards) I wanna that that picture be on same place for both dialogs(child) in tab control. When I activate particular tab the next handler is called :
    Code:
    void Board_TabCtrl::ActivateTabDialogs()
    {
    	int nSel = GetCurSel();
    
    	if(m_Dialog[nSel]->m_hWnd)
    		m_Dialog[nSel]->ShowWindow(SW_HIDE);
    
    	CRect l_rectClient;
    	CRect l_rectWnd;
    
    	GetClientRect(l_rectClient);
    	AdjustRect(FALSE,l_rectClient);
    	GetWindowRect(l_rectWnd);
    	GetParent()->ScreenToClient(l_rectWnd);
    	l_rectClient.OffsetRect(l_rectWnd.left,l_rectWnd.top);
    	for(int nCount=0; nCount < m_nPageCount; nCount++)
    	{
    		m_Dialog[nCount]->SetWindowPos(&wndTop, l_rectClient.left,l_rectClient.top,l_rectClient.Width(),l_rectClient.Height(),SWP_HIDEWINDOW);
    	}
    	m_Dialog[nSel]->SetWindowPos(&wndTop,l_rectClient.left,l_rectClient.top,l_rectClient.Width(),l_rectClient.Height(),SWP_SHOWWINDOW);
    
    	m_Dialog[nSel]->ShowWindow(SW_SHOW);
    }
    
    But when I change tab card that picture flick because I call ShowWindow(SW_SHOW) i.e ShowWindow(SW_HIDE);
    . How can I prevent that picture flick. Is there way to not update part of dialog window or some trick with differernt properties (transparent ....)

    PS: What I want is like there is a hole on that picture place on child dialog windows, so that there no be flickering due to calls of ShowWindow(SW_SHOW) i.e. ShowWindow(SW_HIDE) for child dialogs in tab control;

    Best regards
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice