2012-09-10 61 views
0

可能重複:
Borderless application on maximize is hiding behind the task bar in Win 7 and Win 8當窗口狀態是最大化,則窗口在任務欄後面

我windowstyle是沒有的,我最大化窗口的窗口是任務欄後面 我無法正常看到「同時」窗口。 我嘗試這一點,但它不工作:

this.MaxHeight = SystemParameters.VirtualScreenHeight; 
this.MaxWidth = SystemParameters.VirtualScreenWidth; 
+0

看到這個:http://stackoverflow.com/a/2584487/1253747 – hndr

回答

0

的東西,你可以用開始:

[DllImport("user32.dll")] 
    private static extern int FindWindow(string lpszClassName, string lpszWindowName); 
    [DllImport("user32.dll")] 
    private static extern int ShowWindow(int hWnd, int nCmdShow); 
    private const int SW_HIDE = 0; 
    private const int SW_SHOW = 1; 

    public void WindowsToolbar(bool visible) 
    { 
     int hWnd = FindWindow("Shell_TrayWnd", ""); 
     ShowWindow(hWnd, visible ? SW_SHOW : SW_HIDE); 
    } 

    public void HideTaskBarIfNeeded(Form form) 
    { 
     if (Screen.PrimaryScreen.Equals(Screen.FromRectangle(Screen.GetBounds(form)))) 
     { 
      WindowsToolbar(false); 
     } 
    } 
+0

感謝ü但我想你不明白我的意思。我需要這樣做而不隱藏任務欄。 – user1430430

相關問題