OpenFileDialog and SaveFileDialog

G

Ghost

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;
 
P

Paul G. Tobey [eMVP]

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.
 
P

Paul G. Tobey [eMVP]

If you read the help on that property, you'll see that you are setting it
wrong...

Paul T.
 
F

Fernando Fanton [MSFT]

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;
| > >
| > >
| >
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top