delegate void CloseFormCallback();
private void CloseForm()
{
try
{
if (this.IsDisposed || this.Disposing) return;
CloseFormCallback d = CloseForm;
if (this.InvokeRequired)
{
Invoke(d);
}
else
{
this.Close();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}