国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C# > 正文

C#實現(xiàn)窗體全屏的兩種方法

2019-10-29 19:58:13
字體:
供稿:網(wǎng)友

本文為大家分享了C#實現(xiàn)窗體全屏的具體代碼,供大家參考,具體內(nèi)容如下

方法一:不過此方法有時候會出現(xiàn)莫名的bug

//程序啟動路徑,與生成程序的exe文件在同一目錄下public String exePath = Application.StartupPath;//定義窗體寬高int screenWidth = 0;int screenHeight = 0;screenWidth = (int)System.Windows.SystemParameters.PrimaryScreenWidth;screenHeight = (int)System.Windows.SystemParameters.PrimaryScreenHeight;// 設(shè)置全屏  this.FormBorderStyle = FormBorderStyle.None;   //設(shè)置窗體為無邊框樣式this.WindowState = FormWindowState.Maximized;  //最大化窗體this.Left = 0;this.Top = 0;this.Width = screenWidth;this.Height = screenHeight;//窗體背景圖this.BackgroundImage = Image.FromFile(exePath + "文件名");

方法二:

//程序啟動路徑,與生成程序的exe文件在同一目錄下public String exePath = Application.StartupPath;//窗口左上角位置public Point m_formAutographShowPos;//設(shè)置窗體尺寸this.Width = (int)System.Windows.SystemParameters.PrimaryScreenWidth;this.Height = (int)System.Windows.SystemParameters.PrimaryScreenHeight;this.ClientSize = new System.Drawing.Size(Width, Height);//計算初始位置m_formAutographShowPos.X = 0;m_formAutographShowPos.Y = 0;Location = m_formAutographShowPos;//窗體背景圖this.BackgroundImage = Image.FromFile(exePath + "文件名");

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持VEVB武林網(wǎng)。


注:相關(guān)教程知識閱讀請移步到c#教程頻道。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 扶绥县| 黑河市| 英吉沙县| 临湘市| 平泉县| 含山县| 类乌齐县| 伊宁市| 连平县| 伊金霍洛旗| 梅河口市| 桐梓县| 陕西省| 称多县| 富民县| 岱山县| 富锦市| 邢台市| 格尔木市| 安阳市| 尖扎县| 望奎县| 达州市| 合肥市| 错那县| 灵寿县| 吉水县| 涟源市| 岳阳县| 吉安县| 扬中市| 象山县| 肥乡县| 澄江县| 陆良县| 柳河县| 潞西市| 彩票| 鸡东县| 水富县| 岑巩县|