I'm trying and failing at minimizing my program to my system tray. Can someone tell me what I'm doing wrong?
private void button3_Click(object sender, EventArgs e)
{
System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon();
ni.Icon = new System.Drawing.Icon("icon.ico");
ni.Visible = true;
ni.DoubleClick += delegate(object sender, EventArgs args)
{
this.Show();
this.WindowState = FormWindowState.Normal;
};
this.ShowInTaskbar = false;
}