I think you should not put the drawing related things inside StringGrid1CheckboxToggled. You can see how to customize StringGrid color on my code:http://forum.lazarus.freepascal.org/index.php/topic,37181.msg249361.html#msg249361
This workedCode: Pascal [Select][+][-]procedure TfrmDonnees.StringGrid1PrepareCanvas(sender: TObject; aCol, aRow: Integer; aState: TGridDrawState);begin if (Sender as TStringGrid).ColCount > 1 then begin if (Sender as TStringGrid).Cells[1, aRow] = '1' then (Sender as TStringGrid).Canvas.Font.Color := clRed else (Sender as TStringGrid).Canvas.Font.Color := clBlack; end;
Well, I tried the same thing, changing the color of the text of a tStringGrid row depending on the statis of the checkbox when toggled, but it doesn't seem to do anything for me. What could I possibly be missing here?
Quote from: Bitbeisser on August 10, 2022, 12:00:57 amWell, I tried the same thing, changing the color of the text of a tStringGrid row depending on the statis of the checkbox when toggled, but it doesn't seem to do anything for me. What could I possibly be missing here? Where is column locate for checkbox ? is column 1 ? or is other column ?