本帖最后由 planet5563 于 2010-05-17 23:36:16 编辑

解决方案 »

  1.   

    问题在于:
    if (this.WindowState != FormWindowState.Minimized)
      {
      this.WindowState = FormWindowState.Minimized;
      this.ShowInTaskbar = false;
      }
      else
      {
      this.ShowInTaskbar = true;
      this.WindowState = FormWindowState.Normal;  }如果把this.ShowInTaskbar = false;和this.ShowInTaskbar = true; 去掉后按Ctrl+Z就可以得来回显示窗体
    那如果加上他们,应该如何修改才能实现呢?
      

  2.   

    直接判读是否ShowInTaskbar不行吗?不用管是不是最小化。
      

  3.   


    我的目的是,按1次Ctrl+Z隐藏窗体(包括任务栏中的),再按1次就是把他们再显示出来·
      

  4.   

    if (this.ShowInTaskbar)
      {
      this.WindowState = FormWindowState.Minimized;
      this.ShowInTaskba = false;
      }
      else
      {
      this.ShowInTaskbar = true;
      this.WindowState = FormWindowState.Normal;  }
      

  5.   

    if (this.WindowState != FormWindowState.Minimized)
      {
      this.WindowState = FormWindowState.Minimized;
      this.ShowInTaskbar = false;
      }
      else
      {
      this.ShowInTaskbar = true;
      this.WindowState = FormWindowState.Normal;  }为什么把this.ShowInTaskbar = false和this.ShowInTaskbar = true去掉,就行了呢!!!
    只是不能达到把任务栏的也隐藏了!有什么办法解决呢!!!
      

  6.   

    http://topic.csdn.net/u/20091112/20/7d2e42c7-625e-4963-aa1d-70377ce78cbd.html
      

  7.   

    int i = this.Handle.ToInt32(); 
    this.ShowInTaskbar = ! this.ShowInTaskbar; 
    int j = this.Handle.ToInt32(); 
      

  8.   

            protected override void WndProc(ref Message m)
            {
                const int WM_HOTKEY = 0x0312;
                if (m.Msg == WM_HOTKEY && m.WParam.ToInt32()==100)
                {
                    if (this.WindowState == FormWindowState.Minimized)
                    {
                        this.Height = 516;
                        this.Width = 715;
                        this.WindowState = FormWindowState.Normal;
                        this.ShowInTaskbar = true;
                        //this.Visible = true;
                        this.Focus();
                        //this.notifyIcon1.Visible = false;
                    }
                    else
                    {
                        this.Height = 516;
                        this.Width = 715;
                        this.WindowState = FormWindowState.Minimized;                    //this.Visible = false;
                        this.ShowInTaskbar = false;                    //skinEngine1.SkinFile = "WaveColor1.ssk";
                        //this.notifyIcon1.Visible = true;
                    }
                }
                HotKey.RegisterHotKey(Handle, 100, HotKey.KeyModifiers.Ctrl, Keys.B);            base.WndProc(ref m);        }