New File As Dialog Box

  • Thread starter Thread starter Me
  • Start date Start date
M

Me

Hi,

I need a dialog box in order to create a new file. There is a common dialog
box called OpenFileDialog that gives you all you need to open a file. How
can I create the same thing for a file that I wish to open?
 
There are two dialogs, one is the OpenFileDialog that can be used to open a
file (it give u the path of the file that is selected using the dialog) or
the SaveFileDialog (using which you can specify the path and file name you
want to store). You can access the FileName property to retrieve the file
names selected using both the dialogs. Depending on what you are doing you
can use one. if u want to open an existing file, use OpenFileDialog (use the
FileName property to access the file name and full path of the selected file
in your code), if you want to create a new file (or in other words save a
file) use the SaveFileDialog (again using the FileName property to access the
file name, path and extention specified and use it in your code).

Ali Gardezi
 
Thanks Ali,

I have actually already tried the SaveFileDialog and it works fine. The
only problem that I have is that the dialog box says "Save As" as opposed to
"New File". I can live with it, but it can be rather confusing to a user.
Is there a way that I change the caption to reflect "New File" as opposed to
"Save As"?


G
 
Back
Top