Board index » delphi » Tstringgrid and colors

Tstringgrid and colors

I have a simple string grid with strings in each cell.  I would like to
change the color of any row in which I click any cell.  I have gotten as far
as knowing what cell I have clicked in but can not figure out how to change
the color of that cell.

I am sure that I am missing something very easy:-)

If anyone knows a tutorial on the string grid it would be appreciated.

 

Re:Tstringgrid and colors


Quote
S A Reed wrote in message <72d35h$8r...@forums.borland.com>...
>I have a simple string grid with strings in each cell.  I would like to
>change the color of any row in which I click any cell.  I have gotten as
far
>as knowing what cell I have clicked in but can not figure out how to change
>the color of that cell.

>I am sure that I am missing something very easy:-)

>If anyone knows a tutorial on the string grid it would be appreciated.

You can download a sample tutorial style app from my site:

http://home.ican.net/~wniddery/freedelphistuff.html

--
Wayne Niddery - WinWright Consulting
Delphi, C++Builder, JBuilder, InterDev --
http://home.ican.net/~wniddery/RADBooks.html
...remove chaff when replying...
"You know you've landed gear-up when it takes full power to taxi"

Re:Tstringgrid and colors


TStringGrid has an OnDrawCell event handler. If you keep track of the
current row, then when a new row is selected, you can invalidate both
the previous and new rows, and then let the OnDrawCell handler draw
them as you wish.

Good luck.

Kurt

Other Threads