Visual C# : How To Use SaveFileDialog Control in Windows form Application

in csharp •  6 years ago 

Learn How To Use SaveFileDialog Control in Windows form Application using Visual Studio.

If you like this video then Do share the video in the article to your friends or in your social media accounts. You can also subscribe to the YouTube channel.

I recommend checking out C# in Nutshell Definitive Reference book. You can get a lot of answers to your questions. Plus the new edition of the book can cover some of the latest topics too.

Check out the below video to learn How To Use SaveFileDialog Control in Windows form Application using Visual Studio Professional IDE.

How To Use SaveFileDialog Control in Windows form Application in Visual Studio?

When you want to give permission to user for saving the file to the disk. You can invoke the savefiledialog control on the windows form. And it can be pretty easy to save the file based on the triggers that you send through this dialog.

So basically first we have to create the instance for this control. You can take a look at the code below.

SaveFileDialog SaveFileDialog1 = new SaveFileDialog();

When you invoke this control, you have to also show the dialog box using the following code.

SaveFileDialog1.ShowDialog();

Here you can see when you let the user hit the option of the "save as" or "save file". It should take the user to the file saving dialog box. And it can then let the user to type the name of the file and extension for file etc. So you have to adjust the code for your file saving capacity accordingly.

SaveFileDialog.jpg

Image Credit: Visual Studio Community Edition 2017

So that's simple demo for you to check out.

If you are interested in learning more, check out Visual C# Winforms Tutorials.

I hope the information here helps you. I'd appreciate if you like the video and share it with others.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!