I have to center align the text in a StringGrid (its cells) and I'm using the code you see here. I found it in another answer here and I edited some things.
procedure TForm1.StringGrid1DrawCell(Sender: TObject; aCol, aRow: Integer;
aRect: TRect; aState: TGridDrawState);
var
LStrCell: string;
LRect: TRect;
qrt:double;
begin
LStrCell := StringGrid1.Cells[ACol, ARow];
StringGrid1.Canvas.FillRect(aRect);
LRect := aRect;
DrawText(StringGrid1.Canvas.Handle, PChar(LStrCell), Length(LStrCell), LRect, TA_CENTER);
//other code
end;
I am using Lazarus
and it is giving me an error because it doesn't recognize the TA_CENTER
. Any solutions?