savefiledialog

Getting correct default save name and save directory with spaces in VBA

元气小坏坏 提交于 2019-12-24 19:27:53
问题 I have a lot of excel templates with varying names. One of them is called griep-weerstand v4.xlsb . But my question is about all the templates. I want to integrate the filename into a save script which sets the default save directory and default save name. Both have spaces in the name. After adding the correct number of quotes, the default save directory is set correctly, however, I keep struggling with adding the workbookname to the script. I tried several things and none of them has worked

How can I set topmost at the SaveFileDialog using C#?

删除回忆录丶 提交于 2019-12-24 16:16:08
问题 I want to set topmost my SaveFileDialog. But as you know there is no property. Is there any other way to set TopMost at SaveFileDialog? 回答1: class ForegroundWindow : IWin32Window { [DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow(); static ForegroundWindow obj = null; public static ForegroundWindow CurrentWindow { get { if (obj == null) obj = new ForegroundWindow(); return obj; } } public IntPtr Handle { get { return GetForegroundWindow(); } } } SaveFileDialog dlg=new

When using Intent.ActionOpenDocumentTree can you allow the user to save in a location off the device?

邮差的信 提交于 2019-12-24 14:36:04
问题 This is a Xamarin project but I think the code mostly just wraps the android sdk. When I pick a file I use/get this: var intent = new Intent(Intent.ActionGetContent); intent.AddCategory (Intent.CategoryOpenable); StartActivityForResult (Intent.CreateChooser (intent, "Select file"), 0); Notice how it is capable of opening from remote locations. But when try to pick a directory I use/get this: // https://stackoverflow.com/questions/27889377/action-open-document-tree-only-returns-empty-recent

How to clear a FileDialog's dropdown history?

和自甴很熟 提交于 2019-12-24 12:26:09
问题 It seems that my application is remembering previously saved/opened files. How can clear the recent history and prevent the application from keeping track of saved/opened files in the future? I want to be able to do this from the application, without requiring client involvement. I suppose that the information is saved to the registry. 回答1: Where is recently opened files And then delete them: How to delete a registry value in C# 回答2: just: openfiledialog.FileName = ""; 来源: https:/

How to replace FileName in SaveFileDialog.FileOk event handler

二次信任 提交于 2019-12-24 06:43:59
问题 I'd like to change the file name of the SaveFileDialog in the event handler attached to the FileOk event, in order to replace the file name typed in by the user with another file name in some cases, while keeping the dialog open : var dialog = new SaveFileDialog(); ... dialog.FileOk += delegate (object sender, CancelEventArgs e) { if (dialog.FileName.EndsWith (".foo")) { dialog.FileName = "xyz.bar"; e.Cancel = true; } }; Stepping through the code shows that the FileName gets indeed properly

How to save the contents (Not Texts Nor Images) of a form with a custom extension and open the saved custom file

蹲街弑〆低调 提交于 2019-12-24 00:34:56
问题 I need some help for the project I am working on for my internship. In the VB project, I have a windows form (Form1.vb) with a custom user control called WaveForm1 (which acts like the graph of an oscilloscope). I can run the VB program and assign values to the channels to get the wave forms in the WaveForm1 user control when the project is running. Then, I need to save the WaveForm1 together with the Channels plotted in the graph under a custom file extension (.gph, .wfm ,..) using a

What's the most elegant workaround for the lack of DefaultFileName in SaveFileDialog in Silverlight?

十年热恋 提交于 2019-12-23 10:58:20
问题 The SaveFileDialog in Silverlight lacks a DefaultFileName property, resulting in the user having to enter the file name manually with every file download from a Silverlight application. This is very annoying and there's a lot of criticism about this, see the Silverlight forum. My question is: what is the most elegant way to get around this? 回答1: Prepare the download and let aspx handle the download for you: http://strugglesofacoder.blogspot.com/2011/03/alternative-to-saving-file-in.html 回答2:

Can you save a file on the local drive through RemoteApp instead of saving to server drives?

风流意气都作罢 提交于 2019-12-22 18:03:11
问题 I have an application written in C# WPF, and saving a generated Word document. Through the RemoteApp settings, I've set to show the local user's logical drives, but they don't have letters next to them. They show up as C on myHostname , D on myHostname , etc. When I open up a SaveFileDialog object, it shows Local Disk (C:) , C on myHostname , and D on myHostname in the left-hand pane. How do I set the filename, if there's no corresponding letter? string filename = @"C:\myDirectory\myFile.docx

How to prompt user to save an automated Excel file

左心房为你撑大大i 提交于 2019-12-22 09:40:33
问题 I have searched and nothing that I have found hits directly on what I am looking for (or maybe my searches have not hit on the combo of words). In C# I have created an Excel sheet, using Interop.Excel, in which I insert some data and create a chart. This all works fine when I do a xlWorkBook.SaveAs. What I want to do is prompt the user to put the automated workbook somewhere with thier own file name. I have tried (http://p2p.wrox.com/vb-how/63900-disabling-second-excel-save-prompt.html) where

how do you save from a savefile dialog in C#?

白昼怎懂夜的黑 提交于 2019-12-21 23:41:31
问题 here is the code I am currently using to open a file using the openfiledialog ` private void openToolStripMenuItem_Click_1(object sender, System.EventArgs e) { //opens the openfiledialog and gives the title. openFileDialog1.Title = "openfile"; //only opens files from the computer that are text or richtext. openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; //gets input from the openfiledialog. if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { /