Recent

Author Topic: passing the right value in TFilenameEdit  (Read 2252 times)

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
passing the right value in TFilenameEdit
« on: February 05, 2016, 04:33:34 pm »
For the first time I'm using  TFileNameEdit to get a directory. To extract the directory with the value returned from the dialogname I call property AcceptFileName:
Code: Pascal  [Select][+][-]
  1. procedure TFrmOptions.EDefaultAcceptFileName(Sender: TObject; var Value: String);
  2. begin
  3.   EDefault.Text := ExtractFileDir(Value);
  4. end;          
  5.  
But Edefault.text gets the whole value of the variabele 'Value' and not the extracted directory.

How do I get the right value to EDefault.Text?
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

FTurtle

  • Sr. Member
  • ****
  • Posts: 292
Re: passing the right value in TFilenameEdit
« Reply #1 on: February 05, 2016, 05:31:09 pm »
Quote
AcceptFileName(Sender: TObject; var Value: String);

Code: Pascal  [Select][+][-]
  1. procedure TFrmOptions.EDefaultAcceptFileName(Sender: TObject; var Value: String);
  2. begin
  3.   Value := ExtractFileDir(Value);
  4. end;

 

TinyPortal © 2005-2018