Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

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.

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 ";

 

Edited by Shammikit
Update: i have tried *.* on the filter as well even that doesnt work!
Link to post
Share on other sites

im not a coding expert at all. I dont even code, but shouldnt the ".MP4" be lowercase like the other one? sorry if i said something stupid. lol

My Rig

Spoiler

The Beast (My Rig)   |CPU: Intel Core i7-4790K|  |Cooling: Corsair H100i, Thermaltake Riing RGB fans|  |Motherboard:  ASUS Z97-K|  |RAM: 4x4gb Crucial Ballistix Sport XT 1600|  |Graphics Card: EVGA GeForce GTX 1070 Ti SC GAMING ACX 3.0 Black Edition 8gb |  |Power Supply: Corsair CX-M 650W|  |Case: DIYPC D480-W-RGB ATX Mid Tower Case|  |SSD: 1Tb Samsung 860 Evo|  |Monitor: LG 34UM68-P 2160x1080 DisplayPort, LG 22EA53 1920x1080 DVI, Dell - P2213 22.0" 1680x1050 Display Port|  |Keyboard: CORSAIR Gaming K95 Mechanical Gaming Keyboard - Cherry MX-Brown|  |Mouse: Logitech G402 Hyperion Fury|  |Speakers: Logitech Z200|  |Headphones:Sennheiser GAME ONE, HyperX Cloud Core, Grado Labs SR-60e, Sennheiser HD650 |Webcam: Logitech C920, Logitech C270|

 

Link to post
Share on other sites
3 minutes ago, MrMcMuffinJr said:

im not a coding expert at all. I dont even code, but shouldnt the ".MP4" be lowercase like the other one? sorry if i said something stupid. lol

i previously had it lowercase and i wrote it in uppercase to see if that works. but no. even the flv files dont show up.

Link to post
Share on other sites
19 minutes ago, Shammikit said:

i previously had it lowercase and i wrote it in uppercase to see if that works. but no. even the flv files dont show up.

Well.....I tried

 

¯\_(ツ)_/¯

        |

       /\

My Rig

Spoiler

The Beast (My Rig)   |CPU: Intel Core i7-4790K|  |Cooling: Corsair H100i, Thermaltake Riing RGB fans|  |Motherboard:  ASUS Z97-K|  |RAM: 4x4gb Crucial Ballistix Sport XT 1600|  |Graphics Card: EVGA GeForce GTX 1070 Ti SC GAMING ACX 3.0 Black Edition 8gb |  |Power Supply: Corsair CX-M 650W|  |Case: DIYPC D480-W-RGB ATX Mid Tower Case|  |SSD: 1Tb Samsung 860 Evo|  |Monitor: LG 34UM68-P 2160x1080 DisplayPort, LG 22EA53 1920x1080 DVI, Dell - P2213 22.0" 1680x1050 Display Port|  |Keyboard: CORSAIR Gaming K95 Mechanical Gaming Keyboard - Cherry MX-Brown|  |Mouse: Logitech G402 Hyperion Fury|  |Speakers: Logitech Z200|  |Headphones:Sennheiser GAME ONE, HyperX Cloud Core, Grado Labs SR-60e, Sennheiser HD650 |Webcam: Logitech C920, Logitech C270|

 

Link to post
Share on other sites
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.

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×