dos1234 大哥~
这儿如何定义此rect 为动态某行啊.~
呵呵.偶在drawcell事件中用其它方式实现了上述的功能.只是效果还不太理想.
重画的时候.只是重画了两个由时钟控制不断重写的栅格.其它的栅格则需要再用建材点击一下才能将那行的颜色全部变更过来....其中第8,9列的内容是由时钟动态变更的所以其颜色也变化了.而其它列则因无draw....在这样的循环中..又不是每次stringgrid1.row:=1.所以还有点郁闷啊..大哥们救护.~~>~~>~>~>>~>
procedure TF_lcd.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
i,j:integer;
begin
for i:=1 to stringgrid1.rowcount-1 do
if (stringgrid1.cells[1,i]<>'')AND (stringgrid1.cells[8,i]<>'')AND (stringgrid1.cells[9,i]<>'') then
begin
if (strtofloat(stringgrid1.cells[9,i])-strtofloat(stringgrid1.cells[8,i]))<1 then //'卡上余额小于1块时 改变此行的颜色'
begin
If (ARow=i) and not (acol=0) then
begin
//===================
With StringGrid1 do
begin
Canvas.Brush.Color :=claqua;// ClBlue;
Canvas.FillRect(Rect);
Canvas.font.color:=Clblack;
Canvas.TextOut(rect.left , rect.top, cells[acol, arow]);
end;
end;
end;
//===================
end;
//===
end;