Is there something wrong with my open file dialog filter?
Go to solution
Solved by madknight3,
4 hours ago, Shammikit said:so i have this filter setup for filtering out flv and mp4 files in my open file dialog but it doesnt seem to be working. when i go to my directory with flv and mp4 files they dont show up. what could be the reason. is my filter incorrect?
openFileDialog1.Filter = "mp4 Files (*.mp4)|*.MP4 | flv files(*.flv)|*.flv ";
The problem is the whitespace in the extension parts of the string
openFileDialog1.Filter = "mp4 Files (*.mp4)|*.MP4 | flv files(*.flv)|*.flv "; here^ and here^
You need to remove the whitespace like so
openFileDialog1.Filter = "mp4 Files (*.mp4)|*.MP4| flv files(*.flv)|*.flv";
Note that the description portion of the filter string can have spaces, which is the reason that "mp4 Files (*.mp4)" and "flv files(*.flv)" are allowed. It's just the extension portion of the filter string that can't have spaces.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now