【发布时间】:2015-02-13 18:02:45
【问题描述】:
我用这个功能把任务栏隐藏在屏幕底部
KioskMode.Execute("HHTaskBar", false);
现在我希望确保表单占据我尝试过的所有屏幕:
public static void InitializeKioskMode(Form p_Form)
{
p_Form.FormBorderStyle = FormBorderStyle.Sizable;
p_Form.FormBorderStyle = FormBorderStyle.None;
p_Form.WindowState = FormWindowState.Maximized;
p_Form.Width = Screen.PrimaryScreen.WorkingArea.Width;
p_Form.Height = Screen.PrimaryScreen.WorkingArea.Height;
}
表单不会全屏显示我总是在屏幕底部有一个空白区域(我隐藏的任务栏的空间)
有人知道我该如何解决这个问题吗?
任何帮助将不胜感激
编辑:
我在这里找到了解决方案: Fullscreen app in wince 6.0 c#
重要的是 p_Form.WindowState = FormWindowState.Normal;
之后我使用这样的东西:
IntPtr iptrTB = FindWindow("HHTaskBar", null);
MoveWindow(iptrTB, 0, Screen.PrimaryScreen.Bounds.Height,
Screen.PrimaryScreen.Bounds.Width, 26, true);
[DllImport("coredll.dll")]
private static extern bool MoveWindow(IntPtr hWnd, int x, int y, int cx, int cy, bool repaint);
[DllImport("Coredll")]
internal static extern IntPtr FindWindow(String lpClassName, String lpWindowName);
【问题讨论】:
-
尝试删除
Screen.PrimaryScreen.WorkingArea.Height;这一行,我猜它仍然认为任务栏在那里。 -
我试了一下,但没有任何改变 :(,就像表单不可编辑
标签: c# .net windows windows-ce