Skip to content

OpenFileDialog.DefaultExt

property · OpenFileDialog · cAlgo.API Since 5.1

DesktopCLICloud

Gets or sets a value that specifies the default extension string to use to filter the list of files that are displayed.

Environment behaviour

CLI — not supported. No dialog can be shown in the CLI: ShowDialog returns FileDialogResult.None and the dialog settings are only stored.

Cloud — not supported. No dialog can be shown in the cloud: ShowDialog returns FileDialogResult.None and the dialog settings are only stored.

Definition

public string DefaultExt {get; set;}
openFileDialog.DefaultExt: str

Returns string

Examples

var openFileDialog = new OpenFileDialog { DefaultExt = "txt", Filter = "Text files (*.txt)|*.txt" };
openFileDialog.ShowDialog();
Print("Default extension: {0}", openFileDialog.DefaultExt);
openFileDialog = OpenFileDialog()
openFileDialog.DefaultExt = "txt"
openFileDialog.Filter = "Text files (*.txt)|*.txt"
openFileDialog.ShowDialog()
api.Print(f"Default extension: {openFileDialog.DefaultExt}")