I need to focus on the form if it has already been opened and I want to open a new look.
I have tried this code to solve my problem, but it opens the new form rather than focusing on the already opened form.
foreach (different items in the application. Openform) {form form 1 = item as form; If (form1! = Null) {form1.Activate (); break; } Other {form1 = new form (); Form1.Show (); break; }}
My guess This problem is that you Only really looking in the first form - you got a break statement in both parts of the if statement ... and you are just using it for normal Type
No comments:
Post a Comment