Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to leave text untouched when using a diffent color in a TDBGrid-cell?

1 view
Skip to first unread message

MR

unread,
Jun 30, 2007, 4:02:48 AM6/30/07
to
How to leave text untouched when using a diffent color in a
TDBGrid-cell?

When I want to set a certain TDBGrid-cell to a certain color I use
e.g.
DBGrid->Canvas->Brush->Color=DBGRIDCOLOR_SUCCESS;
DBGrid->Canvas->FillRect(Rect);
DBGrid->Canvas->TextOut(Rect.Left+2, Rect.Top+2, Field->AsString);
in the event
TDBGrid::OnDrawDataCell()

Unfortunately this does not only has impact on the color, but also on
the cell-content: So e.g. the currency is not displayed with two
digits behind the '.' if they are 0, etc. (Removing the
TextOut()-function leaves the cell empty)

What can I do to set another background, but leave the cell-text
untouched?

Thank you,

Michael

0 new messages