在OnSelectCell事件写procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean); begin with StringGrid1 do begin if ARow = 1 then Options := Options + [goEditing] else Options := Options - [goEditing] end; end;
with stringgrid do begin Cells[0,0]:='数量'; Cells[1,0]:='单价'; Cells[2,0]:='金额'; end; 是这意思吗?DrawCell
ARow: Integer; var CanSelect: Boolean);
begin
with StringGrid1 do
begin
if ARow = 1 then
Options := Options + [goEditing]
else
Options := Options - [goEditing]
end;
end;
begin
Cells[0,0]:='数量';
Cells[1,0]:='单价';
Cells[2,0]:='金额';
end;
是这意思吗?DrawCell