I tried to search for this, but I was not sure how to describe it. If it is a duplicate, please point me to the other question. Thanks.
I created a C# Windows Forms app using VS 2008. From the main form it opens a custom dialog form. When the user closes the dialog form, it does not completely disappear before the application starts into it's next task. The outline of various parts of the form remains until some additional tasks are completed.
This looks very unprofessional and it makes the application appear to be broken, even though everything works great. Is there any way to avoid and/or fix this problem?
FYI, the additional tasks are calculations requested after the form has been closed.
Here is the form closing code.
private void CloseForm_Click(object sender, EventArgs e)
{
Properties.Settings.Default.EndDate = cmbBoxRptDate.SelectedValue.ToString();
rptDate = cmbBoxRptDate.SelectedValue.ToString();
Var1 = cmbBoxVar1.SelectedValue.ToString();
Var2 = cmbBoxVar2.SelectedValue.ToString();
this.Close();
}
Here is the code from the main form that opens the custom modal dialog and then disposes of it after it is closed. I think the dispose might be redundant since the form calls the close method on it's own.
RptSettingsForm RS = new RptSettingsForm();
DialogResult DR = RS.ShowDialog();
String var1 = RS.getVar1().ToString();
String var2 = RS.getVar2().ToString();
String rptDate = RS.getDate().ToString();
RS.Dispose();
Then a connection is established to SQL Server to do some report calculations.