用C#做的是winform
要让用户最小化后在系统任务栏中运行,而不是普通任务栏我找到了个用button的,点后触发事件为:this.Visible=false;
//使得notifyIcon控件显示在任务栏上
this.notifyIcon.Visible=true;最小化应该也会触发一个事件,只要能做找到就好了

解决方案 »

  1.   

    Private Sub MinToTrayButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinToTrayButton.Click
                MainNotifyIcon.Visible = True
                Visible = False
            End Sub
    试下,我很少用wiform
      

  2.   

    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 TimerComputerShutdown_Resize(object sender, System.EventArgs e)
    {
    if(this.WindowState==FormWindowState.Minimized)
    {
    this.ShowInTaskbar=false;
    this.Visible=true;
    this.notifyIcon1.Visible=true;
    }
    }
    ------------------------------------------------------------------------------
    我的问题出在:
    打开程序后,在系统下出现在图标
    当把鼠标放上图后,图就消失了,真奇怪