0

Only one instance allow in winforms c#

Hello Members, In my windows forms application that have menu strip. I need to make program that only allow one instance. Means from menu if user open Student and need to open another windows systems not allow him. Please help.

28th Nov 2017, 12:48 PM
Salman Mushtaq
Salman Mushtaq - avatar
3 Respostas
0
You need a program that allow only one instance of what exactly? only one instance of application? or a form?
28th Nov 2017, 2:47 PM
Василий Сибирев
Василий Сибирев - avatar
0
Dear, Let me explain my scenario, I have a form form1 and form2. In form1 there is Menustrip and option to open Form2. Once Form2 is open, user not allowed to do anything on form1 without closing form2.
29th Nov 2017, 7:27 AM
Salman Mushtaq
Salman Mushtaq - avatar
0
I get the solution, I need to use ShowDialog() instead of Show(); Like SybForm f = new SubForm(); f.ShowDialog(this); Where this is instance of main form.
29th Nov 2017, 8:14 AM
Salman Mushtaq
Salman Mushtaq - avatar