Jump to content

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 comment
Share on other sites

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

Favorite Threads: PSU Tier List

 

My Stuff n' Things

Spoiler

The Beast (My Rig)   |CPU: AMD Ryzen 9 3900X|  |Cooling: Enermax Liquimax III, 6x 120mm Noctua Redux|  |Motherboard:  MSI MPG B550 Gaming Plus|  |RAM: 4x32gb 3200 G.Skill TridentZ NEO|  |Graphics Card: EVGA(RIP) GeForce RTX 3070TI FTW3|  |Power Supply: Corsair CX-M 750W|  |Case: Corsair 4000D Airflow Mid Tower Case(Black)|  |SSD: 1Tb WD BLACK NVMe, 500gb NVMe, 1Tb Samsung 850 EVO|  |Monitor: MSI Optix MPG341QR 34" Ultrawide|  |Keyboard: Logitech G815|  |Mouse: Logitech G203 LIGHTSYNC|  |Audio Interface: FiiO K7 DAC/Amp|  |Headphones: Sennheiser HD6XX |Webcam: Logitech C920, Logitech C270|

 

My Network Rack  |Switch: Cisco Dell PowerConnect 5548P|  |Router: Unifi USG|  |Rack: 12U|  |Server: HP Z420|  |Services: Proxmox PVE, Wireguard, Pihole, NVR, NAS|

 

Link to comment
Share on other sites

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 comment
Share on other sites

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

 

¯\_(ツ)_/¯

        |

       /\

Favorite Threads: PSU Tier List

 

My Stuff n' Things

Spoiler

The Beast (My Rig)   |CPU: AMD Ryzen 9 3900X|  |Cooling: Enermax Liquimax III, 6x 120mm Noctua Redux|  |Motherboard:  MSI MPG B550 Gaming Plus|  |RAM: 4x32gb 3200 G.Skill TridentZ NEO|  |Graphics Card: EVGA(RIP) GeForce RTX 3070TI FTW3|  |Power Supply: Corsair CX-M 750W|  |Case: Corsair 4000D Airflow Mid Tower Case(Black)|  |SSD: 1Tb WD BLACK NVMe, 500gb NVMe, 1Tb Samsung 850 EVO|  |Monitor: MSI Optix MPG341QR 34" Ultrawide|  |Keyboard: Logitech G815|  |Mouse: Logitech G203 LIGHTSYNC|  |Audio Interface: FiiO K7 DAC/Amp|  |Headphones: Sennheiser HD6XX |Webcam: Logitech C920, Logitech C270|

 

My Network Rack  |Switch: Cisco Dell PowerConnect 5548P|  |Router: Unifi USG|  |Rack: 12U|  |Server: HP Z420|  |Services: Proxmox PVE, Wireguard, Pihole, NVR, NAS|

 

Link to comment
Share on other sites

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 comment
Share on other sites

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

×