亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

 更新時(shí)間:2018年10月25日 12:11:36   作者:38度6  
這篇文章主要為大家詳細(xì)介紹了C#實(shí)現(xiàn)窗體全屏的兩種方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

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

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

//程序啟動(dòng)路徑,與生成程序的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 + "文件名");

方法二:

//程序啟動(dòng)路徑,與生成程序的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);

//計(jì)算初始位置
m_formAutographShowPos.X = 0;
m_formAutographShowPos.Y = 0;
Location = m_formAutographShowPos;
//窗體背景圖
this.BackgroundImage = Image.FromFile(exePath + "文件名");

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

您可能感興趣的文章:

相關(guān)文章

最新評論