StringGird 改变字帖颜色

procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
  if StringGrid1.Cells[10,ARow] = TestNo then
  begin
    StringGrid1.Canvas.Font.Color := clred;
    StringGrid1.Canvas.FillRect(Rect);
    StringGrid1.Canvas.TextOut(Rect.Left ,Rect.Top, StringGrid1.Cells[ACol, ARow]);
  end;
posted @ 2008-12-23 16:28  谭志宇  阅读(213)  评论(0编辑  收藏  举报