Question on using SaveFileDialog box in .net2.0

Hi all,

Have a bit of a strange one here.

On my form, I'm using a SaveFileDialog box

private
: System::Windows::Forms::SaveFileDialog^ saveFileDialog1;

on initiate

this
->saveFileDialog1 = (gcnew System::Windows::Forms::SaveFileDialog());

this->saveFileDialog1->DefaultExt = L"xml";

this->saveFileDialog1->Filter = L"SCM files|*.xml";

this->saveFileDialog1->InitialDirectory = L"c:\\\\";

when my user calls a save menu option, I initiate the dialog as follows:

 

saveFileDialog1->ShowDialog();

String ^temp = saveFileDialog1->FileName;

....


When I test the code, I get the following result:
1. save file dialogue pops up perfectly
2. if saving a new file name, all is well
3. if REPLACING an existing file, all appears to hang. Actually what is happening is that somehow the save file dialogue has lost the focus. If I minimise the application and then switch back to it, the 'Replace existing file. ' dialogue appears and all proceeds as normal

Anyone have any ideas



Answer this question

Question on using SaveFileDialog box in .net2.0

  • WilsonC

    Try passing the form that owns the SaveFileDialog as a parameter to SaveFileDialog.ShowDialog() method and see if that makes a difference.

  • Question on using SaveFileDialog box in .net2.0