C# winforms How to Prevent form from opening multiple times

preview_player
Показать описание
This tutorial is about how to check if a form is already open c# and to prevent form from opening or showing same form multiple times.
Рекомендации по теме
Комментарии
Автор

THANKS DUDE, THIS IS HELP ME A LOT!, u will get new subs

carilevel
Автор

WORKS LIKE A CHARM !!! Thank you so much!

haqkiemdaim
Автор

f.Text doesn't work for me, but f.Name works.

milosbanda
Автор

Thanks a Lot, but if from are minimize or user trying to recall with click from btn then how to maximize this FRM

conform
Автор

Thank you... you have make this very easy & True.
But after this code How to pass value from one form to another.?

Автор

Thanks a lot, I was really hustling for this

louisrumunu
Автор

Doesn't work for me. the form keeps opening(duplicating everytime I click the button)

jennaho
Автор

What do you do when you're not able to use the Isopen variable

gladdenitiowe
Автор

How to overcome same problem in Microsoft visual studio 2019 wpf

prasadmaharnur
Автор

In your case Click button is not opening the form again !! I m stuck on here i hv matched ur codes.

aryanbhaskar
Автор

Bhai boht sare forms k liye aik hi code kese kam karega? Please help us.

sherzafariqbal
Автор

sir how to prevent tabpage to reopen in c# visual studio, as i have my tabpages in tabcontrol when i click a button to open it, it open but if again click the button it reopens again

raghvirsingh
Автор

When we close form 2 and click again on button error comes

digitalmanojjoshi
Автор

English title and description, but the video is in another language....

davidg
Автор

bool Isopen = false;
foreach(Form f in Application.OpenForms)
{
if(f.Name == "AddCustomer")
{
Isopen = true;
f.WindowState = FormWindowState.Maximized;
f.BringToFront();
break;
}
}
if(Isopen == false)
{
AddCustomer addcus = new AddCustomer();
addcus.Show();
}

KamrulHasan-tvso
Автор

bad code, just change Form.Show() to .ShowDialog()

pawka