I use the code below to make the program ran only one time, I hope the main window can be restored automatically when you try to launch the program for the sencond time.
[STAThread]
static void Main()
{
bool createNew;
Mutex m=new Mutex(true,"SuperCoolPhotoOnlyOneTime",out createNew);
if (createNew)
{
Application.Run(new FormMain());
m.ReleaseMutex();
}
else
{
//if the state of the main window is minimum,I hope the main main can be restored automatically!
}
}

How can I restore the main window after minimize the main window? Thanks!
Entity_X
meet_kuldeep
private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Normal;
}
}
stf-developer
What you write will make the main window being Normal window forever!
Monique555
if( WindowState == FormWindowState.Minimized )
WindowState = FormWindowState.Normal ;
Regards,
Saurabh Nandu
www.MasterCSharp.com
www.AksTech.com
akabir