摘要: procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);vars: String;R: TRect;beginwith StringGrid1 dobeginif ARow=0 then Canvas.Font.Color := clWhite;if ACol=0 then Canvas.Font.Color := clWhite;if Cells[ACol,ARow] = '变色' then //找到内容为'变色'的单元格 阅读全文
posted @ 2010-12-07 10:14 sunjun0427 阅读(4162) 评论(0) 推荐(0) 编辑
摘要: 在OnDrawCell中加入如下代码:procedure TForm1.Stringgrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);begin with Sender as TStringGrid do begin Canvas.FillRect(Rect); DrawText(Canvas.Handle, Pchar(Cells[ACol, ARow]), Length(Cells[ACol, ARow]), Rect, DT_CENTER or DT_SINGLE 阅读全文
posted @ 2010-12-07 09:32 sunjun0427 阅读(846) 评论(0) 推荐(0) 编辑