unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Grids;
type
{ TForm1 }
TForm1 = class(TForm)
StringGrid1: TStringGrid;
procedure StringGrid1Click(Sender: TObject);
private
procedure DoActionAtCell(aCol, aRow: Integer);
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
procedure TForm1.DoActionAtCell(aCol, aRow: Integer);
begin
ShowMessageFmt('Clicked col:%d, row:%d',[aCol, aRow]);
end;
procedure TForm1.StringGrid1Click(Sender: TObject);
var
grd: TStringGrid absolute Sender;
begin
if not (Sender is TStringGrid) then
Exit;
DoActionAtCell(grd.Col, grd.Row);
end;
end.