How do I check if a form is open, and if it is open to close the form?
I tried the following, testing out some code but it keep saying the form is not open even when I know it is:
foreach(Form a in Application.OpenForms)
{
if (a is YouLikeHits_Settings)
{
// About form is open
MessageBox.Show("form open");
break;
}
// About form is not open...
MessageBox.Show("form not open");
break;
}