我的windowstyle是none,我最大化了窗口在任务栏后面的窗口,我看不到while窗口。我尝试了这个,但它不起作用:
this.MaxHeight = SystemParameters.VirtualScreenHeight;
this.MaxWidth = SystemParameters.VirtualScreenWidth;
我的windowstyle是none,我最大化了窗口在任务栏后面的窗口,我看不到while窗口。我尝试了这个,但它不起作用:
this.MaxHeight = SystemParameters.VirtualScreenHeight;
this.MaxWidth = SystemParameters.VirtualScreenWidth;
您可以从以下内容开始:
[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);
}
}