C# Windows Forms Control for choosing a file, consisting of a TextBox where a file path can be entered and a button that brings up an OpenFilenameDialog.
FilenameBox is useful in configuration user interfaces where a path to a file needs to be set.
The Changed event is fired when the selected file changes. (When one of the following happens:)
- The Filename property is changed
- The FileFullname property is changed
- A file is chosen via the selection dialog
- A file is typed into the TextBox
Currently selected file. This is what’s displayed in the TextBox, and may be a relative path. It’s generally better to use FileFullname when setting the file.
Full path to currently selected file. This may be different from what’s displayed in the TextBox as it is always an absolute path.
Gets or sets an option that controls how automatic filename completion works. Is a passthrough for TextBox.AutoCompleteMode but also sets the source to FileSystem if the mode is anything but None.
Starting point for file selection. When the file selection dialog comes up, it will start in this directory.
Whether the base path should be displayed to the user and returned with the Filename property.
Whether the selection should be limited to files within the base path. This is forced to true when StripBasePath is true.
Gets or sets the current file name filter string, which determines the choices that appear in the "Files of type" box in the open file dialog. Is a pass-through for OpenFileDialog.Filter.
Gets or sets the open file dialog box title. Is a pass-through for OpenFileDialog.Title.
Gets or sets whether the button will appear flat.
Whether the selected file exists. Read-only, and does not show in Visual Studio’s properties window.