Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 414
  • Last Modified:

FlickerLess CListCtrl / DoubleBufferd

I Need WORKING example of FlickerLess CListCtrl.
I'm using win 2k and so far non of the exampes I found worked at all (they all flickerd when refreshing / updating items)

regards
0
monster2
Asked:
monster2
  • 4
  • 3
  • 2
1 Solution
 
DanRollinsCommented:
I have never seen this as a significant problem.  I think the trick is to not refresh/repopulate the entire list ... just the item(s) that need changing.  

If you show some typical code that flickers, I'll see if I can point out how to avoid the problem.

-- Dan
0
 
monster2Author Commented:
the problem is that I did'nt wonted to search trough items and to  change them.
I cleard whole list and then populate it from scratch.
I found some examples which should owerride oppaint and on erease handlers but they still flicker.
(I could use this examples to put background bitmap but that's not needed)
I wont to take dc from control make another for in memory drawing and then copy content the one in memory to real dc so that whole drawing is in memory.
0
 
ShaunWildeCommented:
use SetRedraw eg



    m_List.SetRedraw(FALSE); // turn drawing off regardless of list mode

//....
//Insert the items and or delete
//....

    m_List.SetRedraw(TRUE); // turn drawing back on and update the window
    m_List.Invalidate();
    m_List.UpdateWindow();

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
monster2Author Commented:
IT'S FLICKER


m_List.SetRedraw(TRUE);    m_List.Invalidate();
   m_List.UpdateWindow();

the problem is that the list itself is not doublebufferd
when I call UpdateWindow since it's not doublebufferd it flicker.
Only solution is doublebufering
0
 
ShaunWildeCommented:
then you will need to write you own - the above method will allow you to change the items and stop it trying to flicker but in the end you have to update the window to show the new contents
0
 
DanRollinsCommented:
>>I cleard whole list and then populate it from scratch

That is the problem.  

Patient:  Doctor! Doctor! It hurts when I do this!
Doctor:  Well, stop doing that!

Instead of clearing the list and repopulating it, simply replace the old top item with the new top item, and work your way down the list.  After replacing all the items if there are still more, insert them at the end.

Turn off sorting.

-- Dan
0
 
monster2Author Commented:
will try that I'm to tired right now
Thanks
0
 
monster2Author Commented:
well it's not what I asked but since I have decided to use such method (and to change my code :) ) I will accept it

Regards
0
 
DanRollinsCommented:
Thanks.
Better to use a simple, easy-to-understand, easy-to-maintain method than some convoluted double-buffer scheme anyway.

-- Dan
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now