Questions tagged [savefiledialog]

The SaveFileDialog is a (component) class in the .NET Framework that prompts the user to select a location for saving a file.

The SaveFileDialog component allows users to browse the file system and select files to be saved. The dialog box returns the path and name of the file the user has selected in the dialog box. However, you must write the code to actually write the files to disk.

654 questions
10
votes
3 answers

how to save file with GetSaveFileName in win32?

I write this code to get fileName to save my file : #include "stdafx.h" #include int _tmain(int argc, _TCHAR* argv[]) { OPENFILENAME ofn; char szFileName[MAX_PATH] = ""; ZeroMemory(&ofn, sizeof(ofn)); …
Hamed
  • 2,084
  • 6
  • 22
  • 42
9
votes
7 answers

C#, WPF - OpenFileDialog does not appear

I have been searching up and down the web and unfortunately never came across an issue quite like mine, so here goes: My C# WPF application won't show me no OpenFileDialogs or SafeFileDialogs. private void btnBrowseNet_Click(object sender,…
Koarl
  • 246
  • 1
  • 2
  • 10
9
votes
5 answers

System.Windows.Forms.SaveFileDialog does not enforce default extension

I am trying to make SaveFileDialog and FileOpenDialog enforce an extension to the file name entered by the user. I've tried using the sample proposed in question 389070 but it does not work as intended: var dialog = new…
Pierre Arnaud
  • 10,212
  • 11
  • 77
  • 108
9
votes
2 answers

How to check what filter is applied

I am developing exporting data in xpdl format. There are 2 options - version 2.1 and 2.2. I am using SaveFileDialog, but how can I distinguish between those 2 options? SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "xpdl…
user1582878
  • 273
  • 2
  • 7
7
votes
3 answers

How to do something if cancel button on save file dialog was clicked?

I am using c# WinForms. I have a save dialog box that pops up and a message box after that that says it was saved successfully. I just realized that if a user clicks cancel, my message box still comes. How do i tell when a user clicks the cancel…
jAC
  • 3,155
  • 3
  • 18
  • 29
7
votes
4 answers

DialogResult.OK on SaveFileDialog not work

I try, when I press save in SaveFileDialog I do something. I trying fix but always something wrong. SaveFileDialog dlg2 = new SaveFileDialog(); dlg2.Filter = "xml | *.xml"; dlg2.DefaultExt = "xml"; dlg2.ShowDialog(); if (dlg2.ShowDialog() ==…
user3058140
7
votes
3 answers

c# customizing controls on a save dialog -- how to disable parent folder button?

I am working from the sample project here: http://www.codeproject.com/Articles/8086/Extending-the-save-file-dialog-class-in-NET I have hidden the address/location bar at the top and made other modifications but I can't for the life of me manage to…
Bryan
  • 623
  • 1
  • 6
  • 23
7
votes
2 answers

How retrieve only filename from save file dialog

I have a save file dialog and i want to get only the filename entered. Equivalent for openfiledialog.SafeFileName; Save file dialog has no SafeFileName Property and FileName returns both filename, path and extension. Pls how do i extract only…
user2509901
6
votes
2 answers

Can't write local files in Flash Player 10+ online (but works when used locally)

I am trying to write a local file with Flash Player 10+ using the FileReference class, following the format from this blog post by Mike Chambers:…
Steven
  • 1,949
  • 2
  • 17
  • 30
6
votes
2 answers

Qt customizing save file dialog

I need to customize default Qt save file dialog: add some options in it. For example, adding some checkboxes with my own values in it between file type and save/close buttons. Have Qt any ways to do it?
fryme
  • 281
  • 4
  • 15
6
votes
4 answers

How to interrupt the window closing mechanism in scala swing

I'm building a GUI with the SimpleSwingApplication trait in scala swing. What I want to do is to provide a mechanism on close, that asks the user (Yes,No,Cancel) if he didn't save the document yet. If the user hits Cancel the Application shouldn't…
Felix Dietze
  • 602
  • 7
  • 16
6
votes
1 answer

Electron Save Dialog Specify File Type

I have a save dialog in an electron app. At the moment, when a user clicks save it will save with the default name and file extension foo.pdf. When the name is changed, the file extension isn't added. Is there a way to make sure that the .pdf file…
Jason
  • 381
  • 6
  • 21
6
votes
1 answer

How to use filter of SaveFileDialog

I have created Filter with this code: saveFileDialog1.FileName = "SimplifiedLog"; saveFileDialog1.Filter = "RichTextFormate | *.rtf |Text Files | *.txt |All Files| *.*"; saveFileDialog1.Title = "Save Simplified KL…
Uzair Ali
  • 510
  • 14
  • 32
6
votes
1 answer

save file without save file dialog in c# webbrowser control

I am implementing code to automatic download files from client site without manual step using C# code. My requirement is to save the files through C# code by passing path without save file dialog. This is code to show the Save file dialog when…
ALT
  • 63
  • 1
  • 6
6
votes
1 answer

How do I use savefiledialog in vb.net

I have a program called TextEditPro and I just started it, I'm running into a problem. When I had the code for clicking Save As... I don't know how to use the savefiledialog so when you click Save As it will pop up! Any help?
user2122062
  • 81
  • 1
  • 1
  • 5
1
2
3
43 44