在OnDrawCell事件中写代码;
if ACol = 2 then
begin
StringGrid1.Canvas.Brush.Color := clRed;
StringGrid1.Canvas.FillRect(Rect);
StringGrid1.Canvas.TextOut(...
end;
if ACol = 2 then
begin
StringGrid1.Canvas.Brush.Color := clRed;
StringGrid1.Canvas.FillRect(Rect);
StringGrid1.Canvas.TextOut(...
end;
IF ........ THEN
BEGIN
DBGrid1.Canvas.Font.Color := clBlue;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
END
不过vv_www你答的是dbgrid,我就不能给分了。
我肯定会给的。谢谢。