mardi 24 février 2015

Why might OpenFileDialog::ShowDialog() take ~5 seconds to return after clicking the 'OK' button?

I have the following code to prompt a user for a file to open:



System::Windows::Forms::OpenFileDialog fd;
fd.Filter = "All files (*.*)|*.*";
fd.RestoreDirectory = true;
if (fd.ShowDialog() == System::Windows::Forms::DialogResult::OK)
{
m_lblProgress->Text = "Opening file";
}


For some reason, after I click the OK button on the dialog, it takes ~5 seconds before the text on the GUI is updated and it's unresponsive until that happens.


Why might that be and how can I avoid it?


Aucun commentaire:

Enregistrer un commentaire