[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Dialogs' (#lcl)

# TOpenDialog.OnSelectionChange

Event triggered when the user changes the folder of file selection(s) made in the OpenDialog.

## Declaration

Source position: dialogs.pp line 279

`published property TOpenDialog.OnSelectionChange : TNotifyEvent read FOnSelectionChange write FOnSelectionChange;`

## Description

OnSelectionChange is a TNotifyEvent property with the event handler signalled when the folder or file selection for the dialog has been changed. It is signalled (when assigned) from the DoSelectionChange method. The dialog class instance is used as the object for the notification.

OnSelectionChange occurs at run-time when the value in FileName is changed using the native dialog for the platform. The value in FileName has been updated and also stored as the text value for the Files property prior to the event.

When multi-selection is enabled by including ofAllowMultiSelect in Options, OnSelectionChange is signalled for the first value in the range of selected files only. It will, however, be signalled again when the first selection is changed. Other selected file names in Files, which are not the first selected file, are not signalled at all.

Please note that both the OnSelectionChange and OnFolderChange events are signalled during execution when the folder (or directory) is changed to value that does not match the previous value in FileName. OnSelectionChange is signalled first.

## See also

TOpenDialog.DoSelectionChange |  | Performs actions when the selected file in FileName has been changed.
TOpenDialog.OnFolderChange |  | Event signalled when a new directory is selected in the dialog.
TOpenDialog.Options |  | Options to be used for this dialog.
TFileDialog.FileName |  | Contains the UTF-8-encoded name for a file chosen using the dialog.
TFileDialog.Files |  | Stores the names of files (or directories) selected using the dialog.