using System.Windows.Forms;
using System.Drawing;

private NotifyIcon notifyIcon;
private void createNotify()
        {
            notifyIcon = new NotifyIcon();
            notifyIcon.Text = System.Windows.Forms.Application.ProductName;
            notifyIcon.Visible = true;
            ShowInTaskbar = false;
            notifyIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.Windows.Forms.Application.ExecutablePath);

            var open = new System.Windows.Forms.MenuItem("显示");
            //open.Click += Open_Click;
            var hide = new System.Windows.Forms.MenuItem("隐藏");
            //hide.Click += Hide_Click;
            notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(new System.Windows.Forms.MenuItem[] { open, hide });
            //notifyIcon.MouseDoubleClick += _notifyIcon_MouseDoubleClick;
        }

 

相关文章:

  • 2021-12-24
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-01
  • 2022-01-23
  • 2021-12-06
  • 2021-11-23
相关资源
相似解决方案