I'm new with Lazarus and I'm trying to understand actions (with some difficulties...).
I have ActionList1 : TactionList with a standard action FileOpen1 : TFileOpen.
Moreover I have Button1 : TButton on the main form, with its action property
set to FileOpen1 : TFileOpen.
In order to show the filename selected by the user in the dialog, I use the OnAccept
event of the action, with the following code:
procedure TForm1.FileOpen1Accept(Sender: TObject);
begin
ShowMessage(FileOpen1.FileName);
end;
but I have an error by the compiler (identifier idents no member "filename").
Since FileOpen1 object is an instance of class TFileOpen, that inherits the property
FileName from TFileAction, why I can't use this property? And how can I know the filename selected
in the dialog?
Thanks id advance.