Skip to main content

TdxfrmOpenFileDialog Class

The Open dialog form class.

Declaration

TdxfrmOpenFileDialog = class(
    TdxfrmCommonFileDialog
)

Remarks

The Open dialog allows a user to select and open files. This dialog applies look & feel settings specified in the corresponding TdxOpenFileDialog component.

VCL Editors Library: The Open Dialog Form

Invoke the “Open” Dialog

You can perform one of the following actions to invoke the Open dialog at design time:

  • Double-click the TdxOpenFileDialog component.

  • Right-click the component and select Test Dialog in the context menu.

  • Select the component’s FileName property in the Object Inspector and click an ellipsis button.

To invoke the Open dialog at runtime, call the component’s Execute method.

Create a Custom “Open” Dialog Form

Inherit a class from TdxfrmOpenFileDialog to create a custom Open dialog form. Assign a reference to the created class to the OpenFileDialogFormClass global variable to replace the default “Open” dialog with a custom implementation.

UI Elements

“Directory” Box
The Directory box shows the path to the opened disk or folder. A user can click a drop-down menu button to show the most recently used paths and select one of them to change the current directory. A user can also click breadcrumb nodes in the box to open the current folder’s ancestors.
Search Box
The Open dialog has a search box in the top-right corner. A user can type text in the box to search specific files in the current directory.
“Favorites” or “Quick Access” Folder
The dialog shows the Favorites folder at the left border since Microsoft Windows 7. The Quick access folder replaces the Favorites folder in Microsoft Windows 10. They both can display a list of pinned and recently used folders.
Preview Pane
The dialog can display a preview of the last selected file on a pane at the right border. You can use the TdxOpenFileDialog component’s OptionsPreview property to customize the dialog’s preview settings.
“File Name” Box
The File Name box shows the last selected file’s name. A user can type a name of a file to select it in the current directory.
“Open” and “Cancel” Buttons
When a user clicks the Open button, the dialog saves selected file names to the TdxOpenFileDialog component’s Files and FileName properties. The Cancel button does not change Files and FileName property values. Both buttons close the Open dialog.
See Also