Board index » delphi » TStringGrid

TStringGrid

I am changing the font color of certain rows in the stringgrid when it
is populated from an array.  When I scroll through the rows afterwards
the font color  changes to the default color, however if I put a timer
on the form and call the populate method I have setup the font color is
as expected.  How can I trap for the scrolling?

Thanks

Jeff

 

Re:TStringGrid


Quote
In article <39351D51.34C15...@worldnet.att.net>, Jeff wrote:
> I am changing the font color of certain rows in the stringgrid when it
> is populated from an array.  

That is the wrong method to do this. You have to handle the grids
OnDrawCell handler and draw the cell background and content there in the
appropriate color. This event is fired whenever the grid needs to display a
cell. Take care only to change the grids Canvas.Font.Color and
Canvas.brush.Color in the event handler, not the grids font.color or Color
properties, since that would cause the complete grid to redraw.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads