Zakładam że wartość goEditing ustawiona jest domyślnie na true
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Grids;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
procedure StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure StringGrid1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
col,row : integer;
begin
StringGrid1.MouseToCell(x,y,col,row);
if ((col=1)and(row=1)) then
begin
StringGrid1.Options:=StringGrid1.Options-[goEditing];
StringGrid1.EditorMode:=true;
end
end;
procedure TForm1.StringGrid1Click(Sender: TObject);
begin
StringGrid1.Options:=StringGrid1.Options+[goEditing];
end;
end.