Link to home
Start Free TrialLog in
Avatar of PeterDelphin
PeterDelphin

asked on

How to get the color of the clicked cell?

I had this question after viewing TAdvStringGrid: Ā Cell's Background and Font color handling.

In a TAdvStringGrid, in grid.OnGetCellColor event-handler, I've set each cell of the fixed column to a different color:

ABrush.Color := GetMyCustomColor;

Open in new window


Now, when I click on a cell of this fixed column, in the grid.OnClickCell event-handler, I want to get the color of the clicked cell.

How can I do this?

I have tried:

grid.GetCellProperties(ACol, ARow).BrushColor)

Open in new window


But it does not work. I always get the same color: RGB(255, 255, 255).
ASKER CERTIFIED SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PeterDelphin
PeterDelphin

ASKER

Thanks, Geert, meanwhile I came to the same conclusion. In this case, I changed the underlying data to solve my wider problem.