Sortland Automasjon
VCL - FileName.pas - FileName.gif - OpenDialog.gif - src - Arnulf Sortland

Would you like to have the option to use the 'OpenDialog' when editing the 'FileName' property ?

Here is all the code you need to add this kind of functonality to Delphi.

First create a class based on the kind of property we want to edit, here TStringProperty, then we want to override two functions on this class.

We need to specify that we want a 'Dialog' type of property editor, so we return [paDialog] in the GetAttributes function.

Then, we can do as we like in the Edit procedure, which in this case involves a TOpenDialog to let us find any existing file.

And at last we need to Register our new PropertyEditor.


Delphi Snippets - jun 1999 - Arnulf Sortland