-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Expand file tree
/
Copy pathMainWindow.cs
More file actions
35 lines (31 loc) · 987 Bytes
/
MainWindow.cs
File metadata and controls
35 lines (31 loc) · 987 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
32
33
34
35
// // Copyright (c) Microsoft. All rights reserved.
// // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Drawing;
using System.Windows;
using System.Windows.Forms;
namespace NotificationIcon
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private NotifyIcon _notifyIcon;
public MainWindow()
{
InitializeComponent();
}
private void Click(object sender, RoutedEventArgs e)
{
// Configure and show a notification icon in the system tray
_notifyIcon = new NotifyIcon
{
BalloonTipText = @"Hello, NotifyIcon!",
Text = @"Hello, NotifyIcon!",
Icon = new Icon("NotifyIcon.ico"),
Visible = true
};
_notifyIcon.ShowBalloonTip(1000);
}
}
}