Previous Topic

Next Topic

Inhoudsopgave

Book Index

TSaveDialog Component

TSaveDialog

Description

Displays a Save As dialog for saving files.

Remarks

TSaveDialog displays a modal Windows dialog box for selecting file names and saving files. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user clicks Save, the dialog closes and the selected file name is stored in the FileName property.

TSaveDialog Properties

Property Property DefaultExt: String (R/W)

Specifies a default file extension. DefaultExt specifies a file extension that is appended automatically to the selected file name, unless the selected file name already includes a registered extension. If the user selects a file name with an extension that is unregistered, DefaultExt is appended to the unregistered extension. Extensions longer than three characters are not supported. Do not include the period (.) that divides the file name and its extension.

Property Property FileName: String (R/W)

Indicates the name and directory path of the last file selected. The FileName property returns the name and complete directory path of the most recently selected file. The value of FileName is the same as the first item in the Files property. To make a file name appear by default in the dialog's edit box, assign a value to FileName in the Object Inspector or in program code. Programmatic changes to FileName have no effect while the dialog is active.

Property Property Filter: String (R/W)

Determines the file masks (filters) available in the dialog. The file-selection dialog includes a drop-down list of file types under the edit box. When the user picks a file type from the list, only files of the selected type are displayed in the dialog. To create file masks in program code, assign a value to the Filter property that consists of a description and a mask separated by a vertical bar (pipe) character. Do not include spaces around the vertical bar.

Property Property FilterIndex: Integer (R/W)

Determines which filter is selected by default when the dialog opens. FilterIndex determines which of the file types in Filter is selected by default when the dialog opens. Set FilterIndex to 1 to choose the first file type in the list as the default, or set FilterIndex to 2 to choose the second file type as the default, and so forth. If the value of FilterIndex is out or range, the first file type listed in Filter is the default.

Property Property InitialDir: String (R/W)

Determines the current directory when the dialog opens. InitialDir determines the default directory displayed in the file-selection dialog when it opens. For example, to point the dialog at the WINDOWS\SYSTEM directory, set the value of InitialDir to C:\WINDOWS\SYSTEM. If no value is assigned to InitialDir, or if the specified directory does not exist, the initial directory is controlled by the global ForceCurrentDirectory variable.

Property Property Title: String (R/W)

Specifies the text in the dialog's title bar. Use Title to specify the text that appears in the file-selection dialog's title bar. If no value is assigned to Title, the dialog has the title 'Open'.