Shilpa wrote:
Hi,
I have a OpenFileDialog on my windows form whose filter is *.*.
I want the users to be able to further filter the files by giving
*.doc or *.zip etc in the "file name" field of the dialog (Just like
it happens in the open file dialog of MS Word)
Currently, if the user enters a wild card character in the file name
field, it is throwing an exception with the message "Illegal
characters in path".
Please let me know how to achieve the above mentioned functionality.
OpenFileDialog is meant to open a single file OR a set of files which
are selected inside the dialog. So it's not meant to offer the user a
textbox in which the user can type in a wildcard filter.
this thus means that if the user types in a *, the dialog assumes it's
a path / filename character which gives this exception as * isn't a
legal character for a filename.
FB
--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website:
http://www.llblgen.com
My .NET blog:
http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------