• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1580
  • Last Modified:

Resize/scroll flicker in ownerdraw CListCtrl

I have an ownerdrawn list control which resizes and scrolls
just fine, but is there a way to reduce the noticeable flicker?
0
peterg062497
Asked:
peterg062497
  • 2
1 Solution
 
Tommy HuiEngineerCommented:
Have you tried looking at the SetRedraw method in CWnd? You can temporarily turn off redrawing, until the size if fully known and then redraw everything.
0
 
peterg062497Author Commented:
SetRedraw makes the problem worse, as the listctrl blanks completely
from the first of many OnEraseBkgnd messages and won't repaint until
it's allowed from the SetRedraw(TRUE).
It appears that this is a common problem - I've seen it in the NT 4.0 file manager and explorer.  As a view is resized, erase messages keep coming in to stop the window from reflecting what is behind it, followed by OnPaint messages, which causes the flicker.  Trying to override the erase background message to erase only the rectangle(s) that have changed could get really hairy, unless someone else has done it and is willing to part with the code.
If I have mis-analyzed the problem please let me know.
Thanks
Pete Glick
0
 
peterg062497Author Commented:
I researched the problem myself, and found that the vertical and horizontal
redraw bits (CS_VREDRAW, CS_HREDRAW) needed to be removed from the View and Frame style masks.  This cured almost all the flicker.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

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