mike Delvotti

mike Delvotti

  • NA
  • 262
  • 0

Check if another form is running

Jul 15 2014 5:05 AM

I need a little help with detecting if another form is running in my application

To keep it simple if a user opens Form2 from Form1 ideally in my form close event from Form1 I would like to check if Form2 is open and if it is perform a task, I have kind of got it working using try, catch blocks but it's a bit crude!

Can someone give an example please of how best to execute this within the below form closing event:

        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
          


        }


Answers (2)