Reputation: 193
The question is about creating a transparent background in the TStringGrid control. The idea was to modify the white color that is created by default in the grid and use a null color, but I have not succeeded. I share here what has been done so far.
After researching the issue, I was able to show some transperence in the StringGrid by modifying the opacity property, through "Edit Custum Style" in the Background section. This solution is not perfect because it affects the associated TScrollBox control, but at least it is a first approach.
Upvotes: 4
Views: 888
Reputation: 21045
The design of the FMX TStringGrid has no property to make it transparent. However, using styles, transparency can be achieved. You don't need to use styles on the whole application if you don't want to, but you can if you do.
The solution is a simple setting in the style of the grid according to following:
Add a TStringGrid
to an Fmx
form
Edit Default style
structure
select gridstyle - background - content
content
, locate ClipParent
and set to True
Apply and Close
to close the style editor You now have a grid where the area under the header is transparent. If you have more rows (default is 100) than fits, you will also have the scrollbar on the right.
You can remove the header by setting Options.Header = False
in TStringGrid
properties.
I just noticed that you have found some solution too, however relying on Opacity
settings can be tricky, because it affects potentially also other parts of the grid, perhaps in your case, if you select the content
and adjust its opacity?.
Upvotes: 3