设置Dbgrid的DBGrid1DrawDataCell事件中添加如下代码:<br>dbgrid1.Canvas.Font.Color:=clgreen;<br> if ... then<br> SetBkColor(dbgrid1.canvas.handle,clred)<br> else<br> setbkcolor(dbgrid1.canvas.handle,clwhite);<br>dbgrid1.Canvas.TextRect(rect,0,0,field.AsString);<br>dbgrid1.Canvas.Textout(rect.Left,rect.Top,field.AsString);