I have a code like
void onDgvRelations_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
if (e.ColumnIndex == 2 && ktlg == null)
{
this.Cursor = Cursors.WaitCursor;
ktlg = new FormKatalog();
ktlg.Show();
this.Cursor = Cursors.Default;
}
}
The idea is to check if a form
FormKatalog ktlg
is closed. If it's closed I have to create a new form and show it to user. The problem is that after user close the form, variable ktlg will never be null.
How to check properly if a form was not instantiated OR was closed by user?