zoukankan      html  css  js  c++  java
  • C#实现窗体全屏

    方法一:设置窗体属性

    //程序启动路径,与生成程序的exe文件在同一目录下
    public String exePath = Application.StartupPath;
    //定义窗体宽高
    int screenWidth = 0;
    int screenHeight = 0;
    screenWidth = (int)System.Windows.SystemParameters.PrimaryScreenWidth;
    screenHeight = (int)System.Windows.SystemParameters.PrimaryScreenHeight;
    // 设置全屏   
    this.FormBorderStyle = FormBorderStyle.None;     //设置窗体为无边框样式
    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; //设置窗体尺寸 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 + "文件名");
  • 相关阅读:
    十天学会php之第一天
    学习PHP的一些经验
    PHP中的数据类型(1)
    PHP中的常量
    赵凡导师并发知识第一次分享观后感
    面向对象之 __setitem__()、__getitem__()、__delitem__() 用法
    spider数据抓取(第二章)
    识别网站所用技术
    scrapy安装要求
    基于bs4的防止xss攻击,过滤script标签
  • 原文地址:https://www.cnblogs.com/qiantao/p/9847930.html
Copyright © 2011-2022 走看看