[SOLVED] TPaintBox in a TFrame: flickering lazarus / 31-LCL ---------------------------------------------------------------------- DRIGUS · 2011-08-05 07:23 Hi *.*.   First of all, I discovered this problem on a Windows CE 6.0 device. But I believe it could be a LCL problem.   I have a normal TForm with a TPaintBox on it. In order to avoid flickering I set TForm.DoubleBuffered to TRUE and use a TBitmap as buffer which is drawn by TPaintBox.Canvas.Draw in the event TPaintBox.OnPaint. If I need to update the display I use TPaintBox.Invalidate.   This works as expected, without any flickering.   I have another TForm with a (dynamical created) TFrame on it. This frame has a TPaintBox, too. I use the same approach like above, but I can't avoid flickering. TForm.DoubleBuffered is TRUE, setting TFrame.DoubleBuffered to TRUE doesn't change anything.   It seems to me that the problem is the automatic erasing of the background which cause the flickering. Is there any chance to handle it? Under Windows I would perhaps try to catch WM_ERASEBK, first ...   Edit: Lazarus 0.9.31 r31448 FPC 2.4.4 i386-win32-win32/win64 Greetings ---------------------------------------------------------------------- DRIGUS · 2011-08-05 09:01 Issue solved: I override TFrame.EraseBackground by an empty method to avoid flickering. Greetings ---------------------------------------------------------------------- DRIGUS · 2011-08-17 12:10 Addendum:   Due to display problems, caused by not refreshing the TFrame outside the TPaintBox I searched for another solution.   Until further notice I removed the method TFrame.EraseBackground again and use a TPanel with DoubleBuffered := TRUE as a container for the TPaintBox. Greetings