I’m trying to show my form when the user clicks on my notifyicon after the form has been minimized to the system tray. However upon calling Show() the form reappears but is always minimized, i have to click the taskbar icon to un-minimize. Here is my code.
private void Form1_Resize(object sender, EventArgs e)
{
if (WindowState == FormWindowState.Minimized)
{
Hide();
}
}
private void notifyIcon1_Click(object sender, EventArgs e)
{
Show();
//BringToFront();
}
I’ve also tried adding BringToFront() but to no avail.
I need noifyIcon click to show the form, but for it not to be minimized afterward.
Set the
WindowStateproperty toNormal.