Home
Manage Your Code
Snippet: Active Form Check (C#)
Title: Active Form Check Language: C#
Description: This class contains methods for checking if a form is active or not. Views: 97
Author: Eric Ritzie Date Added: 7/25/2008
Copy Code  
1    public class Forms
2    {
3        #region ~VERSION HISTORY   ...        #endregion
15        #region CONTRUCTORS   ...        #endregion
25        #region DECONSTRUCTORS   ...        #endregion
80        #region PRIVATE VARIABLES   ...        #endregion
85        #region PUBLIC METHODS   ...        #endregion
155
156    }
Usage
// Check if there is already a form is already running
if (form.IsFormActive(Form1))
return;

// Create a new instance of the form
Form1 form1 = new Form1();