SaveDialog#

Qualified name: delphivcl.SaveDialog

class SaveDialog#

Bases: OpenDialog

TSaveDialog displays a “Save As” dialog for saving files. 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.

Methods

Execute

Displays the Save As dialog box.

Attributes

ClassName

Returns the TObject.ClassName

ComObject

Specifies the interface reference implemented by the component.

ComponentCount

Indicates the number of components owned by the component.

ComponentIndex

Indicates the position of the component in its owner's Components property array.

ComponentState

Describes the current state of the component, indicating when a component needs to avoid certain actions.

ComponentStyle

Governs the behavior of the component.

Components

<Delphi indexed property Components of type TComponent at 21141642500>

DefaultExt

Specifies a default file extension.

DesignInfo

Contains information used by the Form designer.

FileEditStyle

Determines the style of the file-selection dialog.

FileName

Files

List of selected file names.

Filter

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 configure file masks at design time, click on the ellipsis marks (...) to the right of the Filter property in the Object Inspector. This opens the Filter editor. In the left column of the Filter editor, under Filter Name, type a brief description of each file type that will be available at runtime. In the right column, under Filter, type the file mask corresponding to each description. For example, the description "Text files" might appear to the left of the mask ".txt", and the description "Pascal source files" might appear to the left of the mask ".pas". Since the description appears in the drop-down list at runtime, it is often helpful to show the mask explicitly in the description (for example, "Text files (*.txt)"). 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. For example,.

FilterIndex

Determines which filter is selected by default when the dialog opens.

HistoryList

Maintains a list of previously selected files.

InitialDir

Determines the current directory when the dialog opens.

Name

Specifies the name of the component as referenced in code.

Observers

Indicates the TObservers object added to the TComponent.

OnCanClose

<Delphi property OnCanClose of type TOpenDialog at 21141BF27D0>

OnFolderChange

<Delphi property OnFolderChange of type TOpenDialog at 21141BF28A0>

OnIncludeItem

<Delphi property OnIncludeItem of type TOpenDialog at 21141BF2B10>

OnSelectionChange

<Delphi property OnSelectionChange of type TOpenDialog at 21141BF2970>

OnTypeChange

<Delphi property OnTypeChange of type TOpenDialog at 21141BF2A40>

Options

Determines the appearance and behavior of the file-selection dialog.

OptionsEx

Augments the Options property with additional flags that determine the appearance and behavior of the file-selection dialog.

Owner

Indicates the component that is responsible for streaming and freeing this component.

Tag

Stores a NativeInt integral value as a part of a component.

Title

Specifies the text in the dialog's title bar.

VCLComObject

Represents information used internally by components that support COM.

Execute(ParentWnd: HWND) Boolean#

Displays the Save As dialog box. Execute opens the Save As dialog, returning true when the user selects a file name and clicks Save. If the user cancels the save operation, Execute returns a false value. The code signatures of Execute that appear above are actually overrides of the Execute overloads in the base class Vcl.Dialogs.TCommonDialog.Execute. There is one more overload of Execute for Delphi that appears in the inherited members from TCommonDialog, and this overload takes no input parameters. The ParentWnd parameter is a window handle of type HWND MSDN. If none is provided, the current form handle is used, accessed from Vcl.Forms.TApplication.ActiveFormHandle in the global variable Vcl.Forms.Application.

// Delphi: if SaveDialog1.Execute then

Memo1.Lines.SaveToFile(SaveDialog1.FileName);

// C++: if (SaveDialog1->Execute())

Memo1->Lines->SaveToFile(SaveDialog1->FileName);