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;
                }
            }

  • 相关阅读:
    jmeter录制rabbitmq消息-性能测试
    plsqll连接Oracle的两种方式
    Badboy录制脚本时,提示脚本错误的解决方法
    Decorator
    PyObject and PyTypeObject
    Python LEGB (Local, Enclosing, Global, Build in) 规则
    Python Namespace
    Method Resolve Order (MRO)
    Source Code Structure
    Bound Method and Unbound Method
  • 原文地址:https://www.cnblogs.com/Iyce/p/2738662.html
Copyright © 2011-2022 走看看