Is it better solution for Refreshing Problem in List Control...
-
Hello All I am using List control on my Form View (VC 6.0 on Windows 2000). I have derived my own class from CListCtrl and overwritten "OnCustomDraw" to draw my own List Control. I have placed the control on top of the Tab Control. When I switch from my application to another application and come back, repainting is not happening properly. I am seeing the tab control and the list control is not visible. After some time it appears automatically or if i go to some other tab and come back it appears. I have not overloaded OnDraw in my View Class.If I use CListCtrl without using my own class then repainting happens properly. As a solution for above problem I overloaed OnDraw in my view class and i painted the list controls.
void CMyView::OnDraw(CDC* pDC) { if (m_oTabCtrl.GetCurSel () == 0) { m_oMyListCtrl1.Invalidate (); } else { m_oMyListCtrl2.Invalidate (); } }
After this I am not getting any painting problem. Please let me know what was the cause for above problem and whether is there any better solution than this? Thanks for your time Ravi