Screen flicker when updating ListCtrl items 
Author Message
 Screen flicker when updating ListCtrl items

My program updates the contents of the items in a CListCtrl every second
(onTimer).  The subitem text are updated using CallBack function.
Everytime I update the content the screen flickers.  I try to stop it by
wrapping the update routine with SetRedraw (True / False )  as follows

CMyListCtrl::OnTimer(    )
{
    SetRedraw(False)
        :
        :
    pListCtrl.UpdateItem(i);
        :
        :
    SetRedraw(True) ;
    Invalidate();

Quote:
}      

void CMyListCtrl::OnGetDispInfo(NMHDR* pNMHDR, LRESULT* pResult)
{
        LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;

        if (pDispInfo->item.mask & LVIF_TEXT)
        {
                ItemStruct* pAppItem = (ItemStruct*)
pDispInfo->item.lParam;
                CString strField = UpDateItemText(pDispInfo->item.iItem,

pDispInfo->item.iSubItem);
                :
                :

        }      
        *pResult = 0;

Quote:
}

Is there any way to stop the flickering ?

Thanks...

David Wu



Tue, 18 Apr 2000 03:00:00 GMT  
 Screen flicker when updating ListCtrl items

Quote:
>My program updates the contents of the items in a CListCtrl every second
>(onTimer).  The subitem text are updated using CallBack function.
>Everytime I update the content the screen flickers.  I try to stop it by
>wrapping the update routine with SetRedraw (True / False )  as follows

Do you need to call Invalidate? That will redraw the whole control.

Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.



Thu, 20 Apr 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Copying Selected Item from listctrl to 2nd listctrl

2. Flicker-free custom ListCtrl ?

3. ListCtrl flickering!

4. How to Update One ListCtrl when an item Of another ListCtrl is selected?

5. Print ListCtrl Item's

6. Retrun a simgle Item from ListCtrl

7. How to delete all item in ListCtrl control ?

8. Selecting first 2 sub items in ListCtrl

9. dynamic tooltip for Items in a listctrl

10. Add a item to a listctrl.

11. How to get the listCtrl Item's lParam

12. inserting chkbox in listctrl sub item

 

 
Powered by phpBB® Forum Software