zoukankan      html  css  js  c++  java
  • notifyIcon控件最小化图标

     private void frmMain_Load(object sender, EventArgs e)
            {
                //最小化到托盘
                this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
                notifyIcon1.Icon = new Icon("Main.ico");
                notifyIcon1.Visible = false;
                notifyIcon1.ContextMenuStrip = this.contextMenuStrip1;
                notifyIcon1.DoubleClick += new EventHandler(notifyIcon1_DoubleClick);

           }

      /// <summary>
            /// 最小化到托盘
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void frmMain_Resize(object sender, EventArgs e)
            {
                if (this.WindowState == FormWindowState.Minimized)
                {
                    notifyIcon1.Visible = true;
                    this.ShowInTaskbar = false;
                }
            }
            void notifyIcon1_DoubleClick(object sender, EventArgs e)
            {
                if (this.WindowState == FormWindowState.Minimized)
                {
                    this.WindowState = FormWindowState.Maximized;
                    this.Activate();
                    this.notifyIcon1.Visible = false;
                    this.ShowInTaskbar = true;
                }
            }

  • 相关阅读:
    day38_css
    day39_css_浮动_display
    day36_html
    线段树模板2 洛谷p3373
    hdu1257 最少拦截系统
    树的重心(DFS)
    树的直径(BFS)
    面向对象复习
    面向对象练习题
    面向对象的交互
  • 原文地址:https://www.cnblogs.com/Iyce/p/2738662.html
Copyright © 2011-2022 走看看