zoukankan      html  css  js  c++  java
  • C# 在托盘显示图标

    //上面一行是主窗体InitializeComponent()方法中需要添加的引用

    this.SizeChanged += new System.EventHandler(this.Form1_SizeChanged);

     1 //上面一行是主窗体InitializeComponent()方法中需要添加的引用 
     2         private void Form1_SizeChanged(object sender, EventArgs e)
     3         {
     4             if (this.WindowState == FormWindowState.Minimized)
     5             {
     6                 this.Hide();
     7                 this.notifyIcon1.Visible = true;
     8             }
     9         }
    10 
    11         private void notifyIcon1_Click(object sender, EventArgs e)
    12         {
    13             this.Visible = true;
    14             this.WindowState = FormWindowState.Normal;
    15             this.notifyIcon1.Visible = false;
    16             this.Activate();
    17             this.ShowInTaskbar = true;//任务栏区显示图标
    18         }
  • 相关阅读:
    10.28
    10.25
    10.21
    移动第七次作业
    移动第六次作业
    移动第五次作业
    移动第四次作业
    移动第3次作业
    移动第二次作业
    移动第一次作业
  • 原文地址:https://www.cnblogs.com/zhangzhu/p/3357740.html
Copyright © 2011-2022 走看看