しばじゅんたです。
タイトルカラムは
DBGrid1->Columns->Items[4]->Color = clRed;
ですかね、ヘルプを見ただけで済みません。
データ行列は
void __fastcall TForm1::DBGrid1DrawColumnCell(TObject *Sender,
const TRect &Rect, int DataCol, TColumn *Column,
TGridDrawState State)
{
if( DataCol == 4 )
{
TRect r;
r.Left = Rect.Left+2;
r.Top = Rect.Top+2;
r.Right = Rect.Right-2;
r.Bottom = Rect.Bottom-2;
DBGrid1->Canvas->Brush->Color = clYellow;
DBGrid1->Canvas->Font->Color = clBlue;
DBGrid1->Canvas->FillRect(Rect);
DBGrid1->Canvas->TextRect(r,r.Left,r.Top, データソースのフィールド値 );
}
}
Cの書き方で済みません、参考になれば。
--------------------------------------------------
From: "大須賀" <
delphi...@freeml.com>
Sent: Sunday, May 20, 2012 9:13 AM
To: "DelphiML" <
delphi...@freeml.com>
Subject: [delphi-users:2537] DBGrid の色を指定したい。
MLホームページ:
http://www.freeml.com/delphi-users
----------------------------------------------------------------------
毎日豪華プレゼントキャンペーン開催中!くまポン
http://ad.freeml.com/cgi-bin/sa.cgi?id=it5Ez
------------------------------------------------------[freeml byGMO]--