I'm making a multiform windows form application using C#, what I am trying to do is have a one notification icon, when pressed shows the active form ( the latest one that is open). so having notifyicon for every form is not the answer,
but having the same notifyicon means that I should handle the (clicked) event in the main forum only.
I'm not sure how to tackle this problem, if anyone can provide insight that would be great.
my existing code, which is applicable for the main page only.
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
{
if (this.WindowState == FormWindowState.Normal)
{
Show();
this.Focus();
}
else if (this.WindowState == FormWindowState.Minimized)
{
Show();
this.WindowState = FormWindowState.Normal;
this.Focus();
}
}
Thanks and regards