I have a common dialog opened like this:
private void SaveLogButton_Click(object sender, EventArgs e)
{
try
{
SaveFileDialog dialog = new SaveFileDialog
{
Filter = @"Text file|*.txt",
Title = @"Save to...",
};
if (dialog.ShowDialog()== DialogResult.OK)
{
// Do some job
}
}
catch (Exception ex)
{
// Handle some errors
}
}
Sometimes, however, (with like 10% probability) ShowDialog()
method does not show the dialog itself, though I can see it's parent form, which i can't click too (error sound appears). The only thing that helps here is CtrlAltDel.
No exceptions trigger, and debug wont go after ShowDialog
line. Any suggestions?
Thank you.
Short addition: I'm working on an Excel Add-In using WinForms.