Form

GPALFileSelector

Everything on Settings Every Control Takes applies here too. GPAL.FileSelector builds one. WithTitle sets the dialog's caption and WithInitialDirectory the folder it opens in. WithFilter sets the file type filter, in the usual Windows form of a description and a pattern. WithSelectFolder asks for a folder instead of a file, and WithMultiSelect allows more than one. WithSelectedPath sets the path it starts on, and WithPlaceholder the grey prompt shown while it is empty. WithCompact draws it as a single row rather than a labelled box.

Examples

GPAL Fluent: High-level fluent C# API

//The filter is pairs of description and pattern separated by pipes, the same string a Windows open dialog takes.

GPALFileSelector input = (GPALFileSelector)GPAL.FileSelector

.WithTitle("Select Input File")

.WithInitialDirectory(@"C:sdi")

.WithFilter("CSV files|*.csv|All files|*.*")

.WithPlaceholder("choose a file to import")

.WithName("inputFile");


GPALFileSelector outputFolder = (GPALFileSelector)GPAL.FileSelector

.WithTitle("Select Output Folder")

.WithSelectFolder(true)

.WithCompact(true)

.WithName("outputFolder");

💬 Ask GPAL