[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Resize/scroll flicker in ownerdraw CListCtrl

Posted on 1997-08-07
3
Medium Priority
?
1,534 Views
Last Modified: 2013-11-19
I have an ownerdrawn list control which resizes and scrolls
just fine, but is there a way to reduce the noticeable flicker?
0
Comment
Question by:peterg062497
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1303301
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
 

Author Comment

by:peterg062497
ID: 1303302
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
 

Author Comment

by:peterg062497
ID: 1303303
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

873 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