Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

FlickerLess CListCtrl / DoubleBufferd

Posted on 2001-09-13
9
Medium Priority
?
413 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 400 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

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…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

719 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