关于C++build DBGrid改变某行记录的方法
请问各位大师:c++build DBGrid控件中改变某行的记录的字体颜色是怎么做到的啊???先谢谢大家了,费费神帮帮我吧,急用啊!!!
[解决办法]
void __fastcall TForm1::DBGrid1DrawColumnCell(TObject *Sender, const TRect &Rect, int DataCol, TColumn *Column, TGridDrawState State){ if( this->DBGrid1->DataSource->DataSet->Fields->Fields[0]->AsString.Trim() == "05" ) this->DBGrid1->Canvas->Font->Color = clRed; else DBGrid1->Canvas->Font->Color = clBlack; DBGrid1->Canvas->TextOutA(Rect.left+2,Rect.top+2, Column->Field->AsString.Trim() ); }