zoukankan      html  css  js  c++  java
  • C#获取屏幕的宽度和高度

    转载: https://www.cnblogs.com/zhangruifeng/p/5958010.html

    C#获取屏幕的宽度和高度 //1、在屏幕的右下角显示窗体

    //1、在屏幕的右下角显示窗体
    //这个区域不包括任务栏的
    Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(this);
    //这个区域包括任务栏,就是屏幕显示的物理范围
    Rectangle ScreenArea = System.Windows.Forms.Screen.GetBounds(this);
    int width1 = ScreenArea.Width; //屏幕宽度 int height1 = ScreenArea.Height; //屏幕高度
    this.Location = new System.Drawing.Point(width1 - 窗体宽度, height1 - 窗体高度); //指定窗体显示在右下角
    //2、在母窗体的中间显示子窗体的位置计算
    waitForm.Location = new Point((this.Location.X + (this.Width - waitForm.Width) / 2),
    (this.Location.Y + (this.Height - waitForm.Height) / 2));Web下:System.Web.HttpBrowserCapabilities hbc=new System.Web.HttpBrowserCapabilities();

    Rectangle ScreenArea = Screen.GetWorkingArea(this);
    this.Size = new Size(100,ScreenArea.Height);//设置为屏幕高度
     
  • 相关阅读:
    Redis笔记
    java多线程 interrupt(), interrupted(), isInterrupted()方法区别
    策略模式
    外观模式
    Java线程池原理与架构分析
    状态模式
    模板方法模式
    LeetCode | Path-Sum
    实用工具
    IDEA springboot配置
  • 原文地址:https://www.cnblogs.com/841019rossi/p/14922302.html
Copyright © 2011-2022 走看看