Posted by Johan p14205 on July 19, 2007
In Reply to Re: coloured text in stringgrid posted by Coxy on July 19, 2007: Thanks for the help and quick reply Johan.
: I've put this:
: in a case statement, but some of the cells have black strings in them!? (sometimes next to the green one, sometimes on their own). But the cells are not written to anywhere else...
: I also noticed that if you offset the characters a bit more (e.g. rect.left+5) that there is another character "underneath" which is black.
: Strange. Any ideas?
If there are black strings on their own: might be that your Case statement doesn't deal with *all* possibilities :)
Black strings next to green strings: has to do with the offset. Here's why:
The stringgrid automatically writes the contents of a cell at Rect.Left + 2 in black. Afterwards, the OnDrawCell event comes and you overwrite the cell in green. Therefore, if you offset by more than Rect.Left + 2, the black text stays partially visible "underneath".