h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Prevent Multiple Instance Running

Prevent Multiple Instance Running

In Program.cs file add the below code.
 static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Process[] process = Process.GetProcessesByName(Application.ProductName); //Prevent multiple instance
if (process.Length > 1)
{
MessageBox.Show("{Application Name}  is already running. This instance will now close.", "{Application Name}",
MessageBoxButtons.OK, MessageBoxIcon.Information);
Application.Exit();
}
else
{
Application.Run(new <Initial Form>());
}
}