列的颜色可以改改变的;
if StringGrid.Cells[I,J] = '真' then
StringGrid.cols[I].Color := ClRed else
StringGrid.cols[I].Color := ClBlue;
//好像是cols.时间有点长了,可能忘了,你试一试
if StringGrid.Cells[I,J] = '真' then
StringGrid.cols[I].Color := ClRed else
StringGrid.cols[I].Color := ClBlue;
//好像是cols.时间有点长了,可能忘了,你试一试
var I:integer;
begin
I:=0;
if StringGrid1.Cells[1,i]:='真' then
begin
StringGrid1.cols[I].Color := ClRed
end
else
StringGrid1.cols[I].Color := ClBlue;end;
var I:integer;
begin
I:=0;
if StringGrid1.Cells[1,i]:='真' then
begin
StringGrid1.cols[I].Color := ClRed
end
else
StringGrid1.cols[I].Color := ClBlue;end;
if StringGrid1.Cells[1,i]:='真' then begin
StringGrid1.Canvas.Brush.Color := clRed;
StringGrid1.Canvas.FillRect(Rect);
StringGrid1.Canvas.Font.Color := clBlack; //字体颜色
//居中显示文字
r_left := Rect.Left + (Rect.Right-Rect.Left-StringGrid1.Canvas.TextWidth(tmp)) div 2;
StringGrid1.Canvas.TextRect(Rect, r_left, Rect.Top + 6, tmp); //重画文字
end;
ARow: Integer; Rect: TRect; State: TGridDrawState);写代码
应该可以试一下吧!