how to hide a form when minimize?

Y

ywchan

I have set the ShowInTaskBar property of the form to false
but it still appear when minimized...
I want to have a similar effect as ICQ, when double click on the notify
icon, the form appears and when minimized, it is completely disappeared....
What should I do in order to have such effect? Thanks.
 
G

Guest

Use the following code
private void notifyIcon1_DoubleClick(object sender, System.EventArgs e)
{
this.Visible = true;
this.WindowState = 0;
}

private void Form1_SizeChanged(object sender, System.EventArgs e)
{
if (this.WindowState == System.Windows.Forms.FormWindowState.Minimized)
{
this.Visible = false;
}
}


Regards,
Amal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top