Windows 7 SP1 x64
RAD Studio 10.1 Berlin Update 2
TMS VCL UI Pack v10.1.7.0
Hi,
I have recently found a behaviour that has been missing for some times.
Back in the days, setting the AFont.Color in the OnGetCellColor of a grid for cell using an AddButton would change the color of the text to that button.
Between TMS Component Pack v9.0.2.0 and v9.0.4.0 (I could not test between these version), the behaviour has been lost and the text stays the same colour.
Is this behaviour fixable on your side or do I have to adapt my code?
Here's my test case:
- Create a new project
- Add an AdvStringGrid
- Add and connect these event:
procedure TForm1.FormCreate(Sender: TObject);beginAdvStringGrid1.AddButton(1,1,20,20,'01', haCenter, vaCenter);AdvStringGrid1.AddButton(2,1,20,20,'02', haCenter, vaCenter);AdvStringGrid1.AddButton(3,1,20,20,'03', haCenter, vaCenter);end;procedure TForm1.AdvStringGrid1GetCellColor(Sender: TObject; ARow, ACol: Integer; AState: TGridDrawState; ABrush: TBrush; AFont: TFont);beginif (ACol mod 2) = 0 thenbeginAFont.Color := clRed;AFont.Style := [fsBold];end;end;
- Build and Run the project.
Expected behaviour:
Button "02" has a bold and red text.
Actual behaviour:
Button "02" has a bold text, but the text colour did not change.