Is it possible to hide the file extension when using FileDialog.Filter
I wish to have the filters set to three values:
"All Supported Audio"
"MP3s"
"WMAs"
^ I wish that to be all that there is in the filter drop down box.
What Im getting now is:
"All Supported Audio (*.mp3;*.wma)"
"MP3s (*.mp3)"
"WMAs (*.wma)"
Basicly just get rid of having the actual file extension in the drop down box and just the text..
Any ideas?
FileDialog.Filter hide extensionsHiding file extensions in FileDialog.Filter
Page 1 of 1
8 Replies - 10036 Views - Last Post: 09 June 2008 - 02:38 PM
Replies To: FileDialog.Filter hide extensions
#2
Re: FileDialog.Filter hide extensions
Posted 08 June 2008 - 04:11 PM
Remove the "(*.xxx)" from the Filter string.
openFileDialog1.Filter = "All Supported Audio | *.mp3; *.wma | MP3s | *.mp3 | WMAs | *.wma";
#3
Re: FileDialog.Filter hide extensions
Posted 08 June 2008 - 04:31 PM
jayman9, on 8 Jun, 2008 - 04:11 PM, said:
Remove the "(*.xxx)" from the Filter string.
openFileDialog1.Filter = "All Supported Audio | *.mp3; *.wma | MP3s | *.mp3 | WMAs | *.wma";
I already have my code exactly like that...
below is my code
-----------------------------------------------------------------------------------
OpenFileDialog fl_dlg = new OpenFileDialog(); fl_dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); fl_dlg.Title = "Select File(s)"; fl_dlg.Filter = "All Supported Audio | *.mp3; *.wma | MP3s | *.mp3 | WMAs | *.wma"; fl_dlg.Multiselect = true; DialogResult fl_dlg_result = new DialogResult(); ArrayList file_arraylist = new ArrayList(); fl_dlg_result = fl_dlg.ShowDialog();
-----------------------------------------------------------------------------------
I posted a picture of the window it makes at http://i306.photobuc.../FileDialog.jpg
#4
Re: FileDialog.Filter hide extensions
Posted 08 June 2008 - 04:59 PM
edited
This post has been edited by eclipsed4utoo: 08 June 2008 - 05:00 PM
#5
Re: FileDialog.Filter hide extensions
Posted 08 June 2008 - 05:04 PM
It shows up exactly as you described it in my project. Does it still not show the drop down items that way you want it to in your project?
Is this not how you wanted it?
Is this not how you wanted it?
Attached image(s)
#6
Re: FileDialog.Filter hide extensions
Posted 08 June 2008 - 05:16 PM
jayman9, on 8 Jun, 2008 - 05:04 PM, said:
It shows up exactly as you described it in my project. Does it still not show the drop down items that way you want it to in your project?
Is this not how you wanted it?
Is this not how you wanted it?
The way you have yours is EXACTLY the way I would like it.. I wonder if this is just a Vista issue.. Unfortunatly
this needs to be able to run under vista as well...
The link that I provided above is the way it looks under Vista.
SOO... seems this becomes a Vista issue - Any ideas to over-ride this?
EDIT: Even M$'s page shows that this code should work..
http://msdn.microsof...log.filter.aspx (the window in the demo is from Vista)
This post has been edited by kickit2: 08 June 2008 - 05:20 PM
#7
Re: FileDialog.Filter hide extensions
Posted 08 June 2008 - 06:50 PM
Hmm..it sounds like there is definitely something going on here. It should be working.
Can you post the code that you are using?
Can you post the code that you are using?
#8
Re: FileDialog.Filter hide extensions
Posted 08 June 2008 - 07:27 PM
jayman9, on 8 Jun, 2008 - 06:50 PM, said:
Hmm..it sounds like there is definitely something going on here. It should be working.
Can you post the code that you are using?
Can you post the code that you are using?
Repost of code from above:
OpenFileDialog fl_dlg = new OpenFileDialog(); fl_dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); fl_dlg.Title = "Select File(s)"; fl_dlg.Filter = "All Supported Audio | *.mp3; *.wma | MP3s | *.mp3 | WMAs | *.wma"; fl_dlg.Multiselect = true; DialogResult fl_dlg_result = new DialogResult(); ArrayList file_arraylist = new ArrayList(); fl_dlg_result = fl_dlg.ShowDialog();
If you need more - let me know.. Ill send you the whole damn project if you feel it would help..
Thanks.
#9
Re: FileDialog.Filter hide extensions
Posted 09 June 2008 - 02:38 PM
Fixed it. Using FileDialog.AutoUpgradeEnabled = false it will display the old XP sytle dialog box, which then displays correctly
Hope this helps someone in the future!
OpenFileDialog fl_dlg = new OpenFileDialog(); fl_dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); fl_dlg.Title = "Select File(s)"; fl_dlg.Filter = "All Supported Audio | *.mp3; *.wma | MP3s | *.mp3 | WMAs | *.wma"; fl_dlg.AutoUpgradeEnabled = false; //<-------THIS LINE HERE DOES THE TRICK!!! fl_dlg.Multiselect = true; DialogResult fl_dlg_result = new DialogResult(); ArrayList file_arraylist = new ArrayList();
Hope this helps someone in the future!
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|