I have multiple extensions in the Filter property of OpenFileDialog. Is possible to hide the extensions and show only the description?
Sample:
dialog.Filter = "Image files|*.bmp;*.jpg; many image file extensions here"
I want to show only the text: "Image files" in the file type combo box because the extension string is very long. Is this possible?
This
dialog.Filter = "Image files (*.bmp)|*.bmp;*.jpg"
will only display "Image files (*.bmp)" in the combo box while still showing files with all the specified extensions.
Or you could do
dialog.Filter = "Image files (*.bmp;...)|*.bmp;*.jpg"
to indicate that it looks for files with extension bmp and some other extensions.
This might depend on the OS. I tested with Windows 7.
This should work:
dialog.Filter = "All Supported Audio | *.mp3; *.wma | MP3s | *.mp3 | WMAs | *.wma";
dialog.AutoUpgradeEnabled = false; //using FileDialog.AutoUpgradeEnabled = false it will display the old XP sytle dialog box, which then displays correctly
dialog.ShowDialog();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With