user1581036
user1581036

Reputation: 61

How to change font size at StringGrid in FM2

How can I change font size in StringGrid in rad studio XE3 - FM2 Firemonkey 2 not firemonkey 1

Upvotes: 3

Views: 3402

Answers (3)

Janka
Janka

Reputation: 1988

StringGrid1.StyledSettings.Size := False;
StringGrid1.TextSettings.Font.Size := 18;

This works fine on FireMonkey XE6, But the script that you've reported, regarding the theader, does not work on XE6

Upvotes: 0

Mike Sutton
Mike Sutton

Reputation: 4211

They still don't appear to have made this easy .

The cells are basically TEdits, hence they use the EditStyle for styling. But if you change that you'll change all TEdits. Not what you want.

Ideally there would be a 'CellStyleLookup' property. Set that, modify the style and off you go. But there isn't.

Upvotes: 0

Georgi.Bonchev
Georgi.Bonchev

Reputation: 35

I searched internet and it seems that there is no way to resize text into StringGrid.

You can resize header using FindStyleResource('header'):

Change text size in Firemonkey StringGrid

but it is not clear what to use (if any) instead of 'header' so you can change text in the rows. Delphi help files are not useful at all as I cannot find all available parameters that I can use in FindStyleResource function.

As for the answer below:

StringGrid1.Cells[X,Y] do not have a StyleLookup property.

Also, a some people suggested to use OnDrawCell procedure but again it looks like StringGrid is missing this (at least in Delphi XE3 Firemonkey).

Upvotes: 2

Related Questions