Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenFileDialog: Filter specific number pattern?

Status
Not open for further replies.

jasonp45

Programmer
Aug 23, 2001
212
US
I want to set the OpenFileDialog filter to something like "info.9999", where the 9999 can be any 4 numbers. Is there a wildcard or formatting option to allow this?

I don't want the filter to be "info.*", because I'm looking specifically for files with four numbers after the period.

Thanks.
 
I don't think you can do this. If you must have this functionality, you'll probably need to create your own form that you can use like an OpenFileDialog, that uses regular expressions to apply filters.

If the users will know what four numbers they are looking for up front, then I would just filter for *.1234 or *.5678 based on whatever their input is.

Hope this helps,

Alex

[small]----signature below----[/small]
Majority rule don't work in mental institutions

My Crummy Web Page
 
I finally found a reference to it (link)...there is an additional wildcard character available: ?. It allows you to look for "zero or one character", so I can do something like "info.????". However this won't differentiate between numbers and any other type of character.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top