Recently I had a problem with flickering when resizing a screen due to a gradient background. The problem was mainly noticeable with control on top of the background. Below are a couple of snippets that might help.
First I tried this:
procedure WMEraseBackground(var _message:TMessage); message WM_ERASEBKGND;
procedure TForm.WMEraseBackground(var _message: TMessage);
_message.Result := 1;
This helped with the flicker on the gradient panel, but I noticed other issues with some other controls not painting correctly and a panel having a thicker border. Then I tried this:
procedure WMEnterSizeMove(var Message:TWMMove); message WM_ENTERSIZEMOVE;
procedure WMExitSizeMove(var Message:TWMMove); message WM_EXITSIZEMOVE;
procedure TfrmMain.WMEnterSizeMove(var Message: TWMMove);
// Set controls to visible = false
procedure TfrmMain.WMExitSizeMove(var Message: TWMMove);
// Set controls to visible = true
Doing this really helped the other controls from flicking, when the user resizes the window the controls disappear and then reappear once the resize is complete.