Solved

FlickerLess CListCtrl / DoubleBufferd

Posted on 2001-09-13
9
409 Views
Last Modified: 2013-11-20
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
Comment
Question by:monster2
  • 4
  • 3
  • 2
9 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
ID: 6481724
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
 

Author Comment

by:monster2
ID: 6482019
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
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6482305
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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:monster2
ID: 6482508
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
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6482534
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
 
LVL 49

Expert Comment

by:DanRollins
ID: 6483268
>>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
 

Author Comment

by:monster2
ID: 6483832
will try that I'm to tired right now
Thanks
0
 

Author Comment

by:monster2
ID: 6487544
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
 
LVL 49

Expert Comment

by:DanRollins
ID: 6488522
Thanks.
Better to use a simple, easy-to-understand, easy-to-maintain method than some convoluted double-buffer scheme anyway.

-- Dan
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
cat dog challenge 18 127
Adapt this command to show who installed 29 111
sameEnds challenge 3 180
canBalance challenge 34 98
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question