Add the following code to the main function of the program
bool createdNew;
instance = new (true, "MutexName", out createdNew);
if (createdNew)
{
(new LoginForm());
();
}
else
{
();
}
It can also be written in the following form, a form can only be started once
Form1 a = new Form1();
bool createdNew;
instance = new (true, "MutexName", out createdNew);
if (createdNew)
{
();
();
}
else
{
();
}
bool createdNew;
instance = new (true, "MutexName", out createdNew);
if (createdNew)
{
(new LoginForm());
();
}
else
{
();
}
It can also be written in the following form, a form can only be started once
Form1 a = new Form1();
bool createdNew;
instance = new (true, "MutexName", out createdNew);
if (createdNew)
{
();
();
}
else
{
();
}