delphi哪个数据表控件可以轻易指定某一行的颜色?

来源:百度知道 编辑:UC知道 时间:2024/06/02 21:34:20
delphi哪个数据表控件可以轻易指定某一行某一格的字体和背景颜色?

好像没有,
自己写绘图程序吧
Str1 := strngrd.Cells[acol,arow];
Width := strngrd.Canvas.textwidth(Str1);
Height := strngrd.Canvas.textheight(Str1);
A1 := (strngrd.Colwidths[aCol] - width-2) div 2;//居中对齐
A2 := (strngrd.Rowheights[aRow] - height) div 2;
if gdFixed in state then
strngrd.Canvas.Brush.Color := ClSilver; //设置颜色 else
strngrd.Canvas.Brush.Color := $00F8F8F8;//clCream;//ClWhite;
if ((ARow<>0) and (ACol<>0) and (ACol<>3))then
begin
strngrd.Canvas.Font.Color := strngrd.Font.Color;
if POS('OFF',str1)=0 then strngrd.Canvas.Font.Color := clRed;
end
else strngrd.Canvas.Font.Color := clblack;
strngrd.Canvas.textrect(Rect,Rect.left+A1,Rect.Top+A2,strngrd.Cells[aCol,aRow]);