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.
Supports dark mode, custom icons, checkable menu items, and submenus.
- Native Win32 tray icon integration.
- Context menu with checkable, disabled, and bold items.
- Balloon notifications with custom title, text, and icon.
- Theme mode support (light, dark, system).
- High DPI support for crisp icon rendering.
- Easy API for menu and icon management.
Install NativeTray via NuGet:
dotnet add package NativeTrayExample 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 = new TrayRelayCommand(_ => { /* action */ }) },
new TraySeparator(),
new TrayMenuItem { Header = "Exit", Command = new TrayRelayCommand(_ => Environment.Exit(0)) }
};
trayIcon.ShowBalloonTip(3000, "Hello", "This is a balloon tip.", TrayToolTipIcon.Info);Menu item commands use the ITrayCommand abstraction. For simple actions, use TrayRelayCommand.
You can set the tray icon theme mode:
trayIcon.ThemeMode = TrayThemeMode.Dark;- NativeTray.Demo.WPF for WPF applications.
- NativeTray.Demo.WinForms for WinForms applications.
- NativeTray.Demo.Avalonia for Avalonia applications.
- NativeTray.Demo.WinUI for WinUI applications.
- NativeTray.Demo.Maui for MAUI applications.
- NativeTray.Demo.ConsoleApp for Console applications.
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.