Quick Tip: FullRepaint and fixing flicker in a Delphi VCL app

Here’s a quick tip: when your looking to fix flicker problems in a VCL application be sure you check the FullRepaint property of any TPanel container components used to control form layout. Recently, while working on one of my pet peeves in the IDE, flicker during a window resize, I found the aforementioned property to be the culprit on more than one occasion. The IDE’s editor window is a fairly complicated nesting of (essentially) TPanel components used for docking and client aligned sizing and digging into these panel’s I found several of them had FullRepaint set to true. A quick property toggle and rebuild of coreide (an IDE package) and the problem was fixed.

There are still a few, much smaller issues remaining but since this issue affected the code editor, embedded designer and Welcome page fixing it has made a big difference.

[UPDATE: May, 2008] Related posts:

Using the WS_EX_COMPOSITE window style to eliminate flicker on Windows XP
Quick Tip #2: Fixing flicker caused by WM_ERASEBKGND in a Delphi VCL app

5 thoughts on “Quick Tip: FullRepaint and fixing flicker in a Delphi VCL app

  1. Steve, this is a great post, but there is
    a very confusing issue on processing WM_ERASEBKGND in TWinControl.
    (QC number: 23581).
    That would be really great if this issue was resolved before
    nearest Delphi release.
    Could you please tell me if you are going to resolve that one?

  2. Steve, thanks for this tip, which addresses a property I had overlooked. I was an early user of the double-buffered property to beat flicker back in D2, and have only lately discovered flicker issues in C# using WinForms. A real shame that we’re still battling this, when the fix is so simple, and rarely gets in the way of even near real-time issues.
    I’m also discovering that BeginUpdate and EndUpdate used while populating a ListBox don’t afford me the same clean fix in C# that they did in Win32. I now will have to experiment in Delphi with WinForms, to see whether the behavior is the same….

  3. This is really good news about the Galileo editor. The flickering has always annoyed me greatly, but I haven’t raised my voice about it. I was thinking that I was about the only one annoyed by it. I’m glad to hear that that’s not true and I’m *very* glad that it has been reduced.
    Keep up the good work!!

Comments are closed.