C# 系统托盘图标

C# 系统托盘图标

WPF NotifyIcon 资料

网址:

http://www.codeproject.com/Articles/36468/WPF-NotifyIcon

http://www.hardcodet.net/

https://bitbucket.org/hardcodet/notifyicon-wpf/src

https://www.nuget.org/packages/Hardcodet.NotifyIcon.Wpf/

NuGet:

	Install-Package Hardcodet.NotifyIcon.Wpf

NuGet下载的Package:

Hardcodet.NotifyIcon.Wpf.1.0.8.rar

WPF NotifyIcon 使用

在MainWindow.xaml的 <Grid> 修改中添加

<tb:TaskbarIcon Name="MyNotifyIcon"
  IconSource="Founder.ico"<!--托盘显示图标-->
  ToolTipText="Founder 启动本地程序"><!--鼠标移动到托盘图标显示的文字-->
  <tb:TaskbarIcon.ContextMenu><!--添加菜单-->
    <ContextMenu>
      <MenuItem Header="显示" ToolTip="显示主界面" Click="MenuItem_Click_Show" />
      <MenuItem Header="退出" ToolTip="退出程序" Click="MenuItem_Click_Close" />
    </ContextMenu>
  </tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>
原文地址:https://www.cnblogs.com/yhcao/p/6237633.html