Horje
close an open form when you open it again c# Code Example
close an open form when you open it again c#
// Look through all open forms to see if there is already a Form2 open.
// If it is, Close it. This prevents the user from (purposely) having 5 of the same forms open.
// If you try to cycle through open forms after closing one, it crashes, 
//     because it edits the list of forms while cycling through it
// This is why it is converted into a list of forms first.
foreach (Form frm in Application.OpenForms.Cast<Form>().ToList())
{
    if (frm.Name == "Form2")
    {
        frm.Close();
    }
}




Csharp

Related
select every second row in html table Code Example select every second row in html table Code Example
difference between awake and start unity Code Example difference between awake and start unity Code Example
error the property is part of the object's key Code Example error the property is part of the object's key Code Example
how to cut  image from timeline editor  in c# Code Example how to cut image from timeline editor in c# Code Example
make 2D object move at constant speed unity Code Example make 2D object move at constant speed unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8