c 窗體全屏顯示的完整範例

2021-08-25 07:12:49 字數 1030 閱讀 6531

全屏窗體的完整方法:

1.隱藏工作列

2.設定工作區域

3.窗體最大化

此方法通用wince/mobile/ppc,但api宣告要修改為coredll.dll的引用。

bool fullscreen = false; rectangle rect = new rectangle(); private void button4_click(object sender, eventargs e) else } /// /// 設定全屏或這取消全屏 /// /// true:全屏 false:恢復 /// 設定的時候,此引數返回原始尺寸,恢復時用此引數設定恢復 /// 設定結果 public static bool setfullscreen(bool fullscreen, ref rectangle rectold) else return true; } [dllimport("user32.dll", entrypoint = "showwindow")] public static extern int showwindow(int hwnd, int ncmdshow); public const int sw_show = 5; public const int sw_hide = 0; [dllimport("user32.dll", entrypoint = "systemparametersinfo")] private static extern int systemparametersinfo(int uaction, int uparam, ref rectangle lpvparam, int fuwinini); public const int spif_updateinifile = 0x1; public const int spi_setworkarea = 47; public const int spi_getworkarea = 48; [dllimport("user32.dll", entrypoint = "findwindow")] private static extern int findwindow(string lpclassname, string lpwindowname);

c 窗體全屏顯示的完整範例

全屏窗體的完整方法 1.隱藏工作列 2.設定工作區域 3.窗體最大化 此方法通用wince mobile ppc,但api宣告要修改為coredll.dll的引用。bool fullscreen false rectangle rect new rectangle private void butt...

c 全屏顯示窗體

this.formborderstyle 獲取或設定邊框的樣式 this.windowstate 獲取或設定窗體的窗體狀態 this.formborderstyle system.windows.forms.formborderstyle.fixedsingle 摘要 無邊框。none 0,摘要 固...

子窗體全屏顯示及恢復

ui widget setwindowflags qt dialog ui widget showfullscreen ui widget layout setmargin 0 1.將該窗體恢復型別為qt subwindow 2.呼叫show方法 如果不呼叫會被隱藏 ui widget setwin...