procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var Rect1:TRect; begin if (ACol=2)and(ARow=2) then begin // 用蓝色填充第二行 1、2两列单元的画布 with TStringGrid(Sender).Canvas do begin Brush.Color :=clBlue ; Rect1:=Rect; Rect1.Left :=2* Rect.Left- Rect.Right ; Rect1.Right:= Rect.Right; FillRect(Rect1); end; end; end;
Rect: TRect; State: TGridDrawState);
var Rect1:TRect;
begin
if (ACol=2)and(ARow=2) then begin // 用蓝色填充第二行 1、2两列单元的画布
with TStringGrid(Sender).Canvas do begin
Brush.Color :=clBlue ;
Rect1:=Rect;
Rect1.Left :=2* Rect.Left- Rect.Right ;
Rect1.Right:= Rect.Right;
FillRect(Rect1);
end;
end;
end;
需要完全不要控件自己画,只能由你的方法来画
gzzai(广州仔)说下 怎么实现那?