我找到了个用button的,点后触发事件为:
this.Visible=false;
this.notifyIcon.Visible=true;最小化应该也会触发一个事件,只要能做找到就好了

解决方案 »

  1.   

    用C#做的是winform
    要让用户最小化后在系统任务栏中运行,而不是普通任务栏
    顶!
      

  2.   

    private void Form1_Resize(object sender, System.EventArgs e)
    {
    if(this.WindowState==FormWindowState.Minimized)
    {
    this.ShowInTaskbar=false;
    this.Visible=true;
    this.notifyIcon1.Visible=true;
    }
    }
      

  3.   

    private void contextMenu1_Popup(object sender, System.EventArgs e)
    {
    //退出程序
    this.notifyIcon1.Visible=false;
    this.Close();
    Application.Exit(); } private void notifyIcon1_DoubleClick(object sender, System.EventArgs e)
    {
    //显示窗体
    this.Visible=true; } private void TimerComputerShutdown_Closing(object sender, System.ComponentModel.CancelEventArgs e)
    {
    //指定取消关闭事件
    e.Cancel=true;
    this.Visible=false;
    //使得notify控件显示在任务栏上
    this.notifyIcon1.Visible=true;
    }
    private void Form1_Resize(object sender, System.EventArgs e)
    {
    if(this.WindowState==FormWindowState.Minimized)
    {
    this.ShowInTaskbar=false;
    this.Visible=true;
    this.notifyIcon1.Visible=true;
    }
    }
    -------------------------------------------------------------------
    设置的这一大堆代码都没起效,真是郁闷
      

  4.   

    http://www.daima.com.cn/Info/28/Info29511/