Recent

Author Topic: TStringGrid RowHighlight color  (Read 445 times)

CraigNZ

  • New Member
  • *
  • Posts: 27
TStringGrid RowHighlight color
« 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.

Handoko

  • Hero Member
  • *****
  • Posts: 3234
  • My goal: build my own game engine using Lazarus
Re: TStringGrid RowHighlight color
« Reply #1 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

howardpc

  • Hero Member
  • *****
  • Posts: 3202
Re: TStringGrid RowHighlight color
« Reply #2 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.

CraigNZ

  • New Member
  • *
  • Posts: 27
Re: TStringGrid RowHighlight color
« Reply #3 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,

CraigNZ

  • New Member
  • *
  • Posts: 27
Re: TStringGrid RowHighlight color
« Reply #4 on: April 10, 2019, 10:32:55 pm »
Actually, the SelectedColor property does work.  I forgot to check thee goRowSelect option.