Click here to Skip to main content
15,905,323 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
how to use save dialogbox in c# while i select listbox image
Posted

You should see the following link

SaveFileDialog

Best Regards,
Theingi Win
 
Share this answer
 
Comments
vlad781 21-Feb-11 4:42am    
But thats too complicated for a beginner to understand...Just sayin'
SaveFileDialog saveFile1 = new SaveFileDialog();
            saveFile1.DefaultExt = "*.txt";
            saveFile1.Filter = "RTF Files|*.rtf|TXT Files|*.txt";//you may add/take away the type you want to save the file as...
            saveFile1.FileName = "please select a file extension at the bottom BEFORE saving.";//just what the input box for the file name will say.. you can change this too, to fit your needs.
            if (saveFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK &&
               saveFile1.FileName.Length > 0)
            {
                //here you select what you want to save. for example the text of a richtextbox...
                richtextBox1.SaveFile(saveFile1.FileName, RichTextBoxStreamType.PlainText);
            }

hope i helped
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900