savefiledialog

Run method in separate thread and error with save file dialog

旧街凉风 提交于 2019-12-11 18:17:12
问题 private void button1_Click(object sender, EventArgs e) { new System.Threading.Thread(delegate() { Export(); }).Start(); } private void Export() { int rowcount = ((System.Data.DataTable)this.dgResult.DataSource).Rows.Count; System.Data.DataTable dt = (System.Data.DataTable)this.dgResult.DataSource; if (rowcount > 0) { if (InvokeRequired) { BeginInvoke(new MethodInvoker(delegate() { svDialog.Filter = "Excel|*.xls"; svDialog.Title = "Save an Excel File"; svDialog.ShowDialog(); if (svDialog

C# Save modified image in panel

北城余情 提交于 2019-12-11 17:44:30
问题 I am attempting to save an image as modified by graphics tools such as pens and shapes that can be drawn onto the image. I have done this using a panel with background image and trying to set up a bit map that will save changes within this panel: private void saveToolStripButton_Click(object sender, EventArgs e) { //sets panel1 contents as bit map to be saved at set locations int width = panel1.Size.Width; int height = panel1.Size.Height; using (Bitmap bmp = new Bitmap(width, height)) {

Save User Drawn Bitmap Graphics in c#

≡放荡痞女 提交于 2019-12-11 17:14:26
问题 I have made a program that allows users to draw lines onto a picturebox image but now need to save these lines to be opened at a later date. This is my current code for drawing the lines: public partial class Form1 : Form { public Form1() { InitializeComponent(); pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height); } int Drawshape; private Point p1, p2; List<Point> p1List = new List<Point>(); List<Point> p2List = new List<Point>(); private void Form1_MouseDown(object sender,

How to write to a stream then to file

匆匆过客 提交于 2019-12-11 11:06:47
问题 As part of another project, I found this article explaining how to bring up a SaveFileDialog. But in the center of the code there is a comment that simply reads //Code to write the stream goes here. and seeing as I don't know how to do this either I am at a bit of a loss. In the end my code will be compiling a list of user selections, each separated by a newline character, and then saving that list to a .json with a name and a location specified by the user. The user will have the option to

Replacing OpenFileDialog / SaveFileDialog in .net

寵の児 提交于 2019-12-11 07:49:36
问题 In the application I'm working on, I've been trying to use the SaveFileDialog and OpenFileDialog for their customary purpose (saving and opening files.) However, the application can't support modal forms/dialogs without crashing because too many time-sensitive things happen on the thread that owns the UI. Rewriting the application to move those features off the UI-owning thread is not practical in the immediate term. To finish the feature I've been working on, I need a substitute for the two

How to stop overwriteprompt when creating SaveFileDialog using GetSaveFileName

走远了吗. 提交于 2019-12-11 07:03:27
问题 I want to stop popping of file replace dialog at SaveFileDialog using Windows API method calls. I just want to do this because I create a new folder with the file name given by the user, thus exsistance of another file with the same name is not a matter... Actually I create savefiledialog using Windows function - GetSaveFileName coz I have customized the dialog using hookProc... pls answer if anyone knows... Thanks 回答1: Try this: SaveFileDialog dialog = new SaveFileDialog(); dialog

SaveFileDialog closes automatically directly after calling showDialog()

送分小仙女□ 提交于 2019-12-11 05:15:45
问题 I'm using Windows 7 with Visual Studio 2013. My application is a webbrowser-Component with GeckoFx. At the download-event I trigger to open the SaveFileDialog as follows. But in some cases the dialog disappears directly after callong ShowDialog() and returns a DialogResult.Cancel which jumps into the else-statement, although nobody pressed cancel. No error is thrown. Any suggestions why this happens here? I've no clue about this ... :-( 'Save file dialog Dim saveFileDialog1 As New

Saving application specific save files C# visual studio

不打扰是莪最后的温柔 提交于 2019-12-11 05:05:27
问题 I have created an application in C# with visual studio. The application has a Save dialog box which saves to an xml file and a Load dialog box which loads the xml data into the application. This all works well but what I really want to do is when the application saves the file it creates an application specific file that if the user double clicks it, it will open the application and load the data into it kinda like if you double click a .psd file it will open photoshop and load the file. Any

Save as dialog using php/or html to fwrite in user choice

半城伤御伤魂 提交于 2019-12-11 04:55:30
问题 My doubt is how to open a dialog box(using html/php) to the user so that he can decide where the txt file (which will be created by the php fwrite) will be recorded and under what name. update1: he page will get checkboxes with values, and i want the user to be able to give a directory and a nameOfFile to the php script so that the file will be created in that directory with that name, but i want something like a dialog box to user indicate where he decides that 回答1: PHP cannot write files on

Influence browser download destination

走远了吗. 提交于 2019-12-11 04:24:32
问题 is there a way to influence the browsers download directory for a given HTTP download? The scenario is that some of our users are complaining that they have to click through the directory structure whenever they download a file. As I don't know their individual preferences, it would be nice to make the browser use the last chosen download directory. Is this possible? I know that users can choose their download destination from within most browsers' options dialog (firefox, chrome, etc.), but