I have a main form (main part of my application called frmApp) and there is a button the user can press that opens another form (frmHistory).
Problem is, the user can press this button multiple times and, as my code is, that will spawn multiple instances of the frmHistory form (which is undesirable).
So, I need a way to determine IF the form is already loaded/showing - and if so not spawn another instance of it...
Currently my code looks like:
So this code doesn't check to see if an instance of frmHistory is already showing - can I just check to see if pagefrmHistory == null?
Any hints/thoughts would be appreciated, Thanks,
Problem is, the user can press this button multiple times and, as my code is, that will spawn multiple instances of the frmHistory form (which is undesirable).
So, I need a way to determine IF the form is already loaded/showing - and if so not spawn another instance of it...
Currently my code looks like:
Code:
private void mnDBInfo_Click(object sender, System.EventArgs e)
{ // Display History Form
frmHistory pagefrmHistory = new frmHistory();
pagefrmHistory.Show();
}
Any hints/thoughts would be appreciated, Thanks,