5,388
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
with StringGrid1 do
begin
if gdSelected in State then
begin
Canvas.Brush.Color := clWebGainsboro;
Canvas.FillRect(Rect);
end;
end;
就这样就有
[/quote]
改成这样就OK了
with StringGrid1 do
begin
if gdSelected in State then
begin
Canvas.Brush.Color := clWebGainsboro;
Canvas.FillRect(CellRect(ACol, ARow));
end;
end;
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
with StringGrid1 do
begin
if gdSelected in State then
begin
Canvas.Brush.Color := clWebGainsboro;
Canvas.FillRect(Rect);
end;
end;
就这样就有