0

I want to check the windowstate of a form called main.cs which is opened by form1.cs as showdialog while form1.cs is hidden. I need this to create a tray and hide it in taskbar.

But nothing happens

I saw many solutions and I'm able to follow them, but only in a Form not in a ShowDialog of Form.

Thank you all.

private void form3_Resize (object sender, EventArgs e)
{
    if (WindowState == FormWindowState.Minimized)
    {
        ShowIcon = false;
        notifyIcon1.Visible = true;
        notifyIcon1.ShowBalloonTip(1000);
    }
}

private void notifyIcon1_MouseDoubleClick(object, MouseEventArgs e)
{
     ShowInTaskbar = true;
    notifyIcon1.Visible = false;
    WindowState = FormWindowState.Normal;
}

private void Form3_Load(object sender, EventArgs e)
{
    notifyIcon1.BalloonTipText = "Application minimized";
    notifyIcon1.BalloonTipTitle = "deine mudder hatte recht...!"; 
}
Jason Aller
  • 3,541
  • 28
  • 38
  • 38

0 Answers0