?
Solved

Filtering on two or more file extensions in a File Dialog Box

Posted on 2006-05-23
1
Medium Priority
?
181 Views
Last Modified: 2010-04-16
Hi there,

I have a file dialog box and right now I can filter these 3 extensions ( "All File Types. "Txt Files" and "Jpg files"  ) with the Following:

FileInfo fileinfo = getFileName("All files (*.*)|*.*|Gif files (*.GIF)|*.GIF|Jpeg files (*.jpg)|*.jpg");

How can I combine the Gif and jpeg filters into one so that the user can see all gifs and jpegs together in the directory listing and nothing else?
                  
0
Comment
Question by:phunchak
1 Comment
 
LVL 11

Accepted Solution

by:
anyoneis earned 1000 total points
ID: 16748468
Just group them together, like so:

           OpenFileDialog fdlg = new OpenFileDialog();
            fdlg.Filter = "(*.JPG;*.GIF)|*.JPG;*.GIF";

David
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question