I open a FolderBrowserDialog from a Winforms application. The first time after app start that works fine. Then i start a backgroundworker and do some work.
If i then, after the Backgroundworker finished, open the FolderBrowserDialog again, the app is "locked" because the FolderBrowserDialog is open but hidden somewhere in the background. I have to press the ALT key to make the Dialog visible.
The problem must have to do something with the backgroundworker... How can i solve this issue?
Here is the code where i open the Dialog:
private void metroButtonFolderBrowser_Click(object sender, EventArgs e) {
FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();
folderBrowserDialog1.Description = "CD Importordner wählen";
folderBrowserDialog1.ShowNewFolderButton = false;
DialogResult result = folderBrowserDialog1.ShowDialog();
if (result == DialogResult.OK)
{
importfolder = folderBrowserDialog1.SelectedPath;
ImportfolderLabelText.Text = importfolder;
}
else if (result == DialogResult.Cancel)
{
MessageBox.Show("Abbruch gewählt!");
log.Info("User interrupted folder browser dialog.");
}
}