Lazarus

Programming => LCL => Topic started by: CraigNZ on April 10, 2019, 07:11:52 pm

Title: TStringGrid RowHighlight color
Post by: CraigNZ on April 10, 2019, 07:11:52 pm
Is there a way to set the highlight color for the RowHighlight option.  At runtime, when I click on a cell in a row it is indeed highlighted, but the color is not much different from the row above it and makes it difficult to spot the highlighted row.
Title: Re: TStringGrid RowHighlight color
Post by: Handoko on April 10, 2019, 07:18:46 pm
Not sure, but I know you can manually paint the color you want. Maybe you can try this:

https://forum.lazarus.freepascal.org/index.php/topic,37181.msg249361.html#msg249361 (https://forum.lazarus.freepascal.org/index.php/topic,37181.msg249361.html#msg249361)
Title: Re: TStringGrid RowHighlight color
Post by: howardpc on April 10, 2019, 07:20:12 pm
It may not suit your needs, but there is a (public) SelectedColor property.

Since it is not published you have to set it in code.
Title: Re: TStringGrid RowHighlight color
Post by: CraigNZ on April 10, 2019, 10:27:31 pm
I tried the 'SelectedColor' property but there was no change when I clicked on a cell (the row changed slightly in color to indicate it was selected but not the color I had specified).

I'll try the manual paint method suggested above.

Thanks guys,
Title: Re: TStringGrid RowHighlight color
Post by: CraigNZ on April 10, 2019, 10:32:55 pm
Actually, the SelectedColor property does work.  I forgot to check thee goRowSelect option.