方法如下...
1. 使Form全螢幕,
this.WindowState = FormWindowState.Maximized;
2. 隱藏control box 及 minimize/maximize buttons
3. 使用以下程式碼,顯示或隱藏Form上方的開始選單
方法如下...
1. 使Form全螢幕,
this.WindowState = FormWindowState.Maximized;
2. 隱藏control box 及 minimize/maximize buttons
3. 使用以下程式碼,顯示或隱藏Form上方的開始選單
private const int SW_HIDE = 0x00;
private const int SW_SHOW = 0x0001;
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
private static extern bool ShowWindow(IntPtr hwnd, int nCmdShow);
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
private static extern bool EnableWindow(IntPtr hwnd, bool enabled);
public static void ShowTaskbar()
{
IntPtr h = FindWindow("HHTaskBar", "");
ShowWindow(h, SW_SHOW);
EnableWindow(h, true);
}
public static void HideTaskbar()
{
IntPtr h = FindWindow("HHTaskBar", "");
ShowWindow(h, SW_HIDE);
EnableWindow(h, false);
}
private const int SW_SHOW = 0x0001;
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
private static extern bool ShowWindow(IntPtr hwnd, int nCmdShow);
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
private static extern bool EnableWindow(IntPtr hwnd, bool enabled);
public static void ShowTaskbar()
{
IntPtr h = FindWindow("HHTaskBar", "");
ShowWindow(h, SW_SHOW);
EnableWindow(h, true);
}
public static void HideTaskbar()
{
IntPtr h = FindWindow("HHTaskBar", "");
ShowWindow(h, SW_HIDE);
EnableWindow(h, false);
}
參考文章出處
How to hide start menu?
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=639012&SiteID=1
Update 02/10/2008 此作法是將所有上方工作列移除, 會影嚮到其他功能,並不符合我的要求,後來又找到了另一方法可以保留TaskBar,不顯示Start Menu, ok及x,請見下一篇文章
http://www.dotblogs.com.tw/larry/archive/2008/10/02/5559.aspx