用API函数FindWindow("Shell_TrayWnd",null);找到任务栏
然后用API函数ShowWindow(hWnd ,SW_HIDE)隐藏.

解决方案 »

  1.   

    用findwindow找到任务栏句柄,然后SetWindowPos来隐藏和显示。[DllImport("user32.dll")]public static extern int FindWindow( 
    string lpClassName,  // class name 
    string lpWindowName  // window name 
    ); [DllImport("user32.dll")]public static extern bool SetWindowPos( 
    int hWnd,             // handle to window 
    int hWndInsertAfter,  // placement-order handle 
    short X,                 // horizontal position 
    short Y,                 // vertical position 
    short cx,                // width 
    short cy,                // height 
    uint uFlags            // window-positioning options 
    ); 
    private const int SWP_HIDEWINDOW = 0x80; 
    private const int SWP_SHOWWINDOW = 0x40; 
    SetWindowPos(TaskBarHwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW); //这是隐藏
    SetWindowPos(TaskBarHwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW); //这是显示具体调用自己写吧。
      

  2.   


    int TaskBarHwnd; 
    TaskBarHwnd = FindWindow("Shell_traywnd", ""); 
      

  3.   

    可以试试看将 WindowState属性设成Maximized
       FormBorderStyle属性设成None
      

  4.   

    IntPtr wnd = FindWindow("Shell_TrayWnd",NULL);
    if(wnd)
    {
                  ShowWindow(wnd,SW_SHOW);
    }
      

  5.   

    写错了,应该是if(wnd != IntPtr.Zero)