Horje
c# reopen form if open Code Example
c# reopen form if open
// 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
selenum wait for element c# Code Example selenum wait for element c# Code Example
c# C# read text from a certain line number from string Code Example c# C# read text from a certain line number from string Code Example
go down a line in function documentation Code Example go down a line in function documentation Code Example
winform not maximizing Code Example winform not maximizing Code Example
Type already defines a member called 'Get' Code Example Type already defines a member called 'Get' Code Example

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