1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// das notifyIcon1 kann am einfachsten per Designer erstellt werden
private void notifyIcon1_Click_1(object sender, System.EventArgs e)
{
this.ShowInTaskbar = true;
this.notifyIcon1.Visible = false;
this.WindowState = FormWindowState.Normal;
}
private void Form1_Resize(object sender, System.EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.notifyIcon1.ContextMenu = contextMenu1;
this.ShowInTaskbar = false;
this.WindowState = FormWindowState.Minimized;
this.notifyIcon1.Visible = true;
}
}
|