[2005] Open File Dialog filter problem
I wrote the filter for my openfiledialog object like this:
ofd.Filter = "Access Database (*.mdb)|"
and I think that's correct and it does show up as the only option for filetypes when the ofd opens but the files shown in the actual ofd when it comes up are any type. I could choose a jpg instead of I wanted. So the filter isn't really doing anything at all except changing what the filetype dropdown says. How can I get it to actually enforce my filter rules with what files are able to be chosen?
Re: [2005] Open File Dialog filter problem
Try:
Code:
ofd.Filter = "Access Database (*.mdb)|*.mdb"
Re: [2005] Open File Dialog filter problem
Quote:
Originally Posted by penguin5000
Try:
Code:
ofd.Filter = "Access Database (*.mdb)|*.mdb"
2nd that, thats how I write filters.
Re: [2005] Open File Dialog filter problem
The problem is you have only set the text that shows in the filter drop down box. You haven't set any actual filters. The filters go after the |.
Code:
ofd.Filter = "Access Database (*.mdb)|*.mdb"
You can add more filters by seperating them with simicolons like this.
Code:
ofd.Filter = "Access Database (*.mdb)|*.mdb; *.txt"
Re: [2005] Open File Dialog filter problem
:( I feel dumb now lol. Just think how dumb I'll be after 2 pounds of turkey lol. I better wait until tomorrow to work on it more