-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNotifyIcon.cs
More file actions
31 lines (26 loc) · 865 Bytes
/
NotifyIcon.cs
File metadata and controls
31 lines (26 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Windows.Forms;
namespace Examples {
class MainForm : Form {
public static void Main() {
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
public MainForm() {
Icon = Examples.Properties.Resources.Gammasoft;
Text = "NotifyIcon example";
label1.Parent = this;
label1.AutoSize = true;
label1.Location = new System.Drawing.Point(10, 10);
label1.Text = "Double click on Gammasoft tray icon\nto show or hide this form.";
notifyIcon1.Icon = Examples.Properties.Resources.Gammasoft;
notifyIcon1.Text = "NotifyIcon example";
notifyIcon1.Visible = true;
notifyIcon1.DoubleClick += delegate {
Visible = !Visible;
};
}
private NotifyIcon notifyIcon1 = new NotifyIcon();
private Label label1 = new Label();
}
}