2012-09-10 63 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

相关问题