Mega Code Archive

 
Categories / Delphi / Examples
 

My control flickers when it gets repainted!

If you do not include csOpaque in ControlStyle then Invalidate calls will cause the control's background to be erased. If you draw your control's background in the Paint method then you should do this in your constructor: constructor TMyControl.Create; begin inherited; ControlStyle := ControlStyle + [csOpaque]; end;