|
-
Nov 22nd, 2007, 10:53 AM
#1
Thread Starter
Hyperactive Member
[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?
I tried to end process on Visual Studio 2005
but PETA stopped me saying it's smart enough
to be a living creature 
-
Nov 22nd, 2007, 11:42 AM
#2
Addicted Member
Re: [2005] Open File Dialog filter problem
Try:
Code:
ofd.Filter = "Access Database (*.mdb)|*.mdb"
-
Nov 22nd, 2007, 11:44 AM
#3
Hyperactive Member
Re: [2005] Open File Dialog filter problem
 Originally Posted by penguin5000
Try:
Code:
ofd.Filter = "Access Database (*.mdb)|*.mdb"
2nd that, thats how I write filters.
Learning C♯
Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)
-
Nov 22nd, 2007, 11:44 AM
#4
Lively Member
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"
-
Nov 22nd, 2007, 01:16 PM
#5
Thread Starter
Hyperactive Member
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
I tried to end process on Visual Studio 2005
but PETA stopped me saying it's smart enough
to be a living creature 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|