Mega Code Archive

 
Categories / Delphi / VCL
 

Avoiding flicker on drawcell

Question: When I set the font color on a DrawGrid's DrawCell event using Font.Color := clRed; I get an endless loop of flicker. How can I get around this? Answer: Be sure to fully qualify the canvas that you are using. Example: If (Row = 0) then begin DrawGrid1.Canvas.Font.Color := clRed; DrawGrid1.Canvas.TextOut(Rect.Left,Rect.Top, IntToStr(Col)); end;