NativeTray is a modern, easy-to-use library for displaying tray icons (NotifyIcon) in .NET applications. It supports WPF, WinForms, and other .NET platforms, providing non-intrusive system notifications and quick access functionality in the Windows taskbar.
$ dotnet add package NativeTrayNativeTray is a modern, easy-to-use library for displaying tray icons (NotifyIcon) in .NET applications. It supports WPF, WinForms, and other .NET platforms, providing non-intrusive system notifications and quick access functionality in the Windows taskbar.
Supports dark mode, custom icons, checkable menu items, and submenus.
Install NativeTray via NuGet:
dotnet add package NativeTray
Example usage:
using System.NativeTray;
var trayIcon = new TrayIconHost
{
ToolTipText = "NativeTray Demo.",
Icon = ... // Load your icon handle here.
};
trayIcon.Menu = new TrayMenu
{
new TrayMenuItem { Header = "Item 1", Command = _ => { /* action */ } },
new TraySeparator(),
new TrayMenuItem { Header = "Exit", Command = _ => Environment.Exit(0) }
};
trayIcon.ShowBalloonTip(3000, "Hello", "This is a balloon tip.", TrayToolTipIcon.Info);
You can set the tray icon theme mode:
trayIcon.ThemeMode = TrayThemeMode.Dark;
NativeTray is released under the MIT license. You are free to use and modify it, as long as you comply with the terms of the license.