Howto Use TOpenDialog
From Lazarus wiki
Simple and short guideline:
- Place a TOpenDialog widget on your form.
It can be placed anywhere as it is not visible during program run time but only during design time.
It is located on the Dialogs tab of the component palette and is the leftmost component
- In your code write something similar to:
var filename: string; if OpenDialog1.Execute then begin filename := OpenDialog1.Filename; ShowMessage(filename); end;