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?
Edit - The plot thickens..
This delay only appears when the OpenFileDialog
is launched from a System::Windows::Forms::ToolStripMenuItem::Click
event.
Changing a label's text instead of launching the OpenFileDialog
doesn't incur any delay at all so what's special about closing the OpenFileDialog
window?
Aucun commentaire:
Enregistrer un commentaire