c #windows ce设备无法将表单大小更改为全屏

时间:2015-02-13 18:02:45

标签: c# .net windows windows-ce

我使用功能

隐藏了屏幕底部的任务栏
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);

1 个答案:

答案 0 :(得分:0)

我在这里找到了解决方案: 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);