This is a valid format:
openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ;
From the MSDN documentation:
Remarks
For each filtering option, the filter string contains a description of the
filter, followed by the vertical bar (|) and the filter pattern. The
strings for different filtering options are separated by the vertical bar.
The following is an example of a filter string: "Text files
(*.txt)|*.txt|All files (*.*)|*.*"
For more info got to
http://msdn.microsoft.com/mobility
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Reply-To: "Ghost" <
[email protected]>
| From: "Ghost" <
[email protected]>
| References: <
[email protected]>
<e#
[email protected]>
| Subject: Re: OpenFileDialog and SaveFileDialog
| Date: Fri, 6 Aug 2004 20:50:52 +0400
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <#H#
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: ge-tbs-ats77-tc-ppp6.wanex.net 213.131.38.167
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:58856
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| I have argument exeption at line:
| saveFileDialog.Filter = "Text files (*.txt)";
|
| "Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
| wrote in message | > You can just drag and drop them on your form. What, exactly, are you
| saying
| > that the problem is? The dialog never appears or what?
| >
| > Paul T.
| >
| > | > > Can anybody show me an examples how do I use OpenFileDialog and
| > > SaveFileDialog in Compact Framework?
| > >
| > > I do so but, it doesn't work:
| > >
| > > SaveFileDialog saveFileDialog = new SaveFileDialog();
| > > saveFileDialog.Filter = "Text files (*.txt)";
| > > if (saveFileDialog.ShowDialog() == DialogResult.OK)
| > > txtFileTextBox.Text = saveFileDialog.FileName;
| > >
| > >
| >
| >
|
|
|