C#中设置窗体最小化到托盘,托盘图标一直显示,MyEclipse注册机.Net版

由于自己在写一个小的C#程序,在程序中需要使用到系统托盘的功能。

在网上找了很多都是这样的:

 

private   void   Form1_SizeChanged(object   sender,   System.EventArgs   e)   
  {   
  NotifyIcon组件   
  if(this.WindowState==System.Windows.Forms.FormWindowState.Minimized)   
  {   
  this.Hide();   
  this.notifyIcon1.Visible=true;   
  }   
    
    
  }   
    
  private   void   notifyIcon1_Click(object   sender,   System.EventArgs   e)   
  {   
  if(this.WindowState==System.Windows.Forms.FormWindowState.Minimized)   
  {   
  this.Visible=true;   
  this.WindowState=System.Windows.Forms.FormWindowState.Normal;   
  this.notifyIcon1.Visible=false;   
  }   
    
    
  }   

 或者这样的

 

 

private void Form1_SizeChanged(object sender, EventArgs e)   
        {   
            if (this.WindowState == FormWindowState.Minimized)//最小化      
            {   
                this.ShowInTaskbar = false;   
                this.notifyIcon1.Visible = true;   
            }      
  
        }   
  
              private void notifyIcon1_Click(object sender, EventArgs e)   
        {   
            if (this.WindowState == FormWindowState.Minimized)   
                this.WindowState = FormWindowState.Normal;   
            this.Activate();   
            this.notifyIcon1.Visible = false;   
            this.ShowInTaskbar = true;      
  
        }

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/hanghwp/archive/2009/06/12/4263233.aspx

 

 

都有一个特点:都是将托盘的图标隐藏起来的。而不是我要的一直显示在系统的托盘上面。

以上代码如果让托盘一直显示在上面则会报错。

后找到此代码试用OK!到此解决问题。

private void mainSoftForm_SizeChanged(object sender, EventArgs e)
        {
            //判断如果是最小化时窗体隐藏
            if (this.WindowState == FormWindowState.Minimized)
            {
                this.Visible = false;
                this.Hide();
            }
        }

        private void myIcon_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (this.WindowState == FormWindowState.Minimized)
            {
                this.Visible = true;
                this.Show();
                this.WindowState = FormWindowState.Normal;
            }
        }

 

MyEclispe标准版注册码MyEclipse专业版注册码

 

这个就是我做的程序了。 使用了DevComponents.DotNetBar2.dll 的一点效果

 

注册码:

Admin

NLR8ZC-855444-67536856734523947(专业版)

NLR8ZO-855444-67536856215078531(标准版)

 

好了就这么多!这个注册码的算法于网上收集的java文件改写的。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值