SaveAs dialog box force not to close after the file is saved

D

damu maddy

Hi every body I need a strange behaviour of SaveAs dialog Box

When i save a file using SaveAs dialog Box Usually the Dialog box closes
after the file is been saved

What i need is that SaveAs Dialog box should not close after hitting the
save button and I should see the saved file in the Dialog box

Any help is Greatly Appreciated



Thanks DAM



The code I use to generate Dialog box is



public void FileSaveAs()

{


Stream myStream;

SaveFileDialog saveFileDialog1 = new SaveFileDialog();



saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";

saveFileDialog1.FilterIndex = 2;

saveFileDialog1.RestoreDirectory = true;




if (saveFileDialog1.ShowDialog() == DialogResult.OK)

{

if ((myStream = saveFileDialog1.OpenFile()) != null)

{

String filename = saveFileDialog1.FileName;



myStream.Close();




}

}



}
 
N

Norman Yuan

It sounds really strange indeed.

Anyway, you can try to show the SaveAs dialog box again after the previous
SaveAs dialog box being closed and the file being saved as "some file", with
InitDir and FileName pointing to the saved file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top