Skip to content

OpenFileDialog constructor

constructor · OpenFileDialog · cAlgo.API Since 5.1

DesktopCLICloud

Creates an OpenFileDialog.

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 OpenFileDialog()
OpenFileDialog()

Examples

var openFileDialog = new OpenFileDialog { Title = "Select a CSV file", Filter = "CSV files (*.csv)|*.csv" };
if (openFileDialog.ShowDialog() == FileDialogResult.OK)
    Print("Selected file: {0}", openFileDialog.FileName);
openFileDialog = OpenFileDialog()
openFileDialog.Title = "Select a CSV file"
openFileDialog.Filter = "CSV files (*.csv)|*.csv"
if openFileDialog.ShowDialog() == FileDialogResult.OK:
    api.Print(f"Selected file: {openFileDialog.FileName}")