TStrinGrid OnPrepareCanvas lazarus / 31-LCL ---------------------------------------------------------------------- mtanner · 2016-08-02 23:37 I want to control the background colour of each cell separately in a TStringGrid. I though the OnPrepareCanvs method would allow me to do this, simply by setting the Canvas.Brush.Color property. But if I use this to set the color to, say, clRed on a special cell, but to clWhite on all other cells, then after I have changed to clRed it stays that way for all the following cells. I think I must be failing to understand something. Also the text is obliterated in any cell for which I have set the nrish color in OnPrepareCanvas. ---------------------------------------------------------------------- wp · 2016-08-03 05:29 I don't know what you are doing - OnPrepareCanvas working correctly here ---------------------------------------------------------------------- mtanner · 2016-08-03 08:53 I deleted the code that did not work, and have just rentered it - it's trivial, just setting the brush color according to aCol and aRow. Now it does work, so I must have had a typo in there which caused what looked like seemingly incorrect behaviour. Embarrasing!