473,386 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to use SaveFileDialog?

Rob
Hi, I have recently installed Visual Studio 2005 and although I'm starting to
understand the 64 bit differences, I seem to have run into another problem.

I would like to implement a simple "Save As.." dialog box, which back in the
day I remember was extremely simple, but now I can't find how I wrote the
code back then, and I don't understand how to use the .NET component
"SaveFileDialog".

In the help files it says that in order to use SaveFileDialog, one must use:
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
But I can't find how to manke use of those.

Could someone please point me in the direction of how to implement a "Save
As.." dialog?

Thank you.
Apr 25 '06 #1
1 3014
There are some project settings you have to set up before you can use .Net.
If you created a new .Net project this is all done for you. If not, read on.

First you have to make sure you have the project set to use managed
extensions. This is in the General category in the project properties
dialog. After that you need to make sure you have a reference to the
assembly you need. Right click on the project name in solution explorer and
select Add Reference. This will bring up a dialog. Find the
System.Windows.Forms assembly and add it.

Now, in your source code you want to use the namespace, so near the top put
this:
using namespace System::Windows::Forms;

Now you should be all set to do the example found on MSDN.
http://msdn.microsoft.com/library/en...classtopic.asp

As an alternative to the adding a reference thing you can use the following
line with your include files:
#using <System.Windows.Forms.dll>

"Rob" wrote:
Hi, I have recently installed Visual Studio 2005 and although I'm starting to
understand the 64 bit differences, I seem to have run into another problem.

I would like to implement a simple "Save As.." dialog box, which back in the
day I remember was extremely simple, but now I can't find how I wrote the
code back then, and I don't understand how to use the .NET component
"SaveFileDialog".

In the help files it says that in order to use SaveFileDialog, one must use:
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
But I can't find how to manke use of those.

Could someone please point me in the direction of how to implement a "Save
As.." dialog?

Thank you.

Apr 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael A. Covington | last post by:
I've just determined, by experimenting, that regardless of its Filter and DefaultExt properties, a SaveFileDialog will let you save the file with *any* registered extension. For instance, if you...
6
by: Ken Allen | last post by:
I have enocuntered something wierd. If I invoke an instance of the above dialog and elect to save the file in a directory where a file of that name does not exist, then the return is...
2
by: Yoshi | last post by:
Hi Everyone! I am using the SaveFileDialog class. I want the user to specify the "SaveAs" filename so I can use that name when creating a text document. Here is my question below. When the...
2
by: Dennis C. Drumm | last post by:
Is there a way for the parent that calls the SaveFileDialog.ShowDialog to consume events associated with this dialog such as LocationChanged, Moved and Closed events? I had been working on a way...
5
by: juli | last post by:
Hello dear fellows! Is there any chance that you know how can I upload a file with the saveFileDialog control to a specific folder-> I want any file uploaded to be save on specific folder with...
3
by: josh | last post by:
How do I make it actually save or open a file? It only opens the dialogs. What do I type to get it to save? Here's what I have so far: Public Class frmMainApp Inherits...
2
by: ad | last post by:
Hi, I want to use saveFileDialog to save a file (like c:\aa.zip) to another place. How can I assgin c:\aa.zip to saveFileDialog
17
by: Peter Duniho | last post by:
I searched using Google, on the web and in the newsgroups, and found nothing on this topic. Hopefully that means I just don't understand what I'm supposed to be doing here. :) The problem: ...
3
by: =?Utf-8?B?UmljaA==?= | last post by:
I want to create a class library project (dll) for use with a com app. The idea is to use .Net objects in com. I also want to include a SaveFileDialog in the class library. Is it possible to...
8
by: Joe Duchtel | last post by:
Hello - I have the following code to detemine a file name when my application is saving a file. The problem is that if the file already exists and I select the Yes button in the "Do you want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.