'Open Windows Form only once in C# [duplicate]
Possible Duplicate:
How to avoid multiple instances of windows form in c#
I want to show open form only once in an application without creating them as MDI form.
Solution 1:[1]
You can just use show\hide methods for opening your form. You also need to initialize all form fields after each time you show this.
Solution 2:[2]
Use a boolean variable with default value false which you set to true once the form was shown, and check the variable on form opening.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Oleg Ignatov |
| Solution 2 | CloudyMarble |
