Coloring a stringgrid cell background(solved) lazarus / 39-Graphics ---------------------------------------------------------------------- jbmckim · 2020-09-12 19:48 I get using OnPrepareCanvas to change cell color.  I do this successfully in a couple places. What's confusing me is a slightly different requirement.  I need to allow the user to remove an alarm state (stringgrid cell, red background) from a row by pushing a button. (Going cell by cell is fine. The UI requirement is a column but that can be done cell by cell.) When this happens, there's no change to the cell value per se, just a change to the background.  Therefore, OnPrepareCanvas doesn't fire.  (The problem only occurs on reset as the initial alarm is thrown in response to a new value being added to the cell in question.) Therefore, how do I change the background color without modifying cell value? ---------------------------------------------------------------------- wp · 2020-09-12 19:51 Call StringGrid.Invalidate to enforce a redraw of the grid; as a consequence of this OnPrepareCanvas will be called for each cell before it is painted. ---------------------------------------------------------------------- jbmckim · 2020-09-15 21:04 Outstanding.  Thanks.