procedure TFrmMain.StringGrid1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
if gdFocused in state then exit;
end;
procedure TMainFrame.StringGrid5DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
with Rect, StringGrid1.Canvas do
begin
if State = [gdSelected] then
begin
Brush.Color:=CLMoneyGreen;
FillRect(Rect);
Font.Color:=clBlack;
end;
TextRect(Rect,Left+2,Top+2,StringGrid1.Cells[ACol,ARow]);
end;
end;
去试试吧、别忘了结帐!