C#WinForm获取屏幕大小

当前的屏幕除任务栏外的工作域大小
    this.Width = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
    this.Height = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;

当前的屏幕包括任务栏的工作域大小
this.Width=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
this.Height=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;

任务栏大小
this.Width=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width-System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
this.Height=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height-System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;

winform实现全屏显示
WinForm:
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.TopMost = true;   

winform获取屏幕区域
Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(this);
时间: 2024-08-27 11:10:22

C#WinForm获取屏幕大小的相关文章

cocos2d-x JS 获取屏幕大小或中点

以一张背景图为例: var HelloWorldLayer = cc.Layer.extend({ ctor:function () { this._super(); var bg = new cc.Sprite(res.HelloWorld_png); var size = cc.director.getWinSize();//获取屏幕大小 bg.x = size.width / 2; // x轴/2即为x轴中点 bg.y = size.height / 2; // y轴/2即为y轴中点 th

wift - 使用UIScreen类获取屏幕大小尺寸

UISreen类代表了屏幕,开发中一般用来获取屏幕相关的属性,例如获取屏幕的大小. 1 2 3 4 5 6 7 //获取屏幕大小 var screenBounds:CGRect = UIScreen.mainScreen().bounds println(screenBounds) //iPhone6输出:(0.0,0.0,375.0,667.0) //获取屏幕大小(不包括状态栏高度) var viewBounds:CGRect = UIScreen.mainScreen().applicati

java 获取屏幕大小

使用Java AWT类可以很方便取得屏幕分辨率及可用屏幕大小. 01.Dimension scrSize=Toolkit.getDefaultToolkit().getScreenSize();   此语句可取得屏幕实际大小.如屏幕分辨率是1024*768时,scrSize.width的值为1024,scrSize.height的值为768. 01.Insets scrInsets=Toolkit.getDefaultToolkit().getScreenInsets(GraphicsEnvir

在Qt中获取屏幕大小

如何在Qt中获取屏幕大小呢? 首先要调用QApplication类中的一个static方法,如下: QDesktopWidget *QApplication::desktop() QApplication类用来管理GUI应用程序的控制流和主要设置,其派生关系如下: QApplication:QGuiApplication:QCoreApplication:QObject 在主程序中,一定是QApplication而非QGuiApplication或QCoreApplication,否则会有 错误

Android获取屏幕大小和设置无标题栏

android获取屏幕大小非常常用,例如写个程序,如果要做成通用性很强的程序,适用屏幕很强,一般布局的时候都是根据屏幕的长宽来定义的,所以我把这个总结一下,方便日后忘记的时候查阅.还有就是有时候写程序根据需求不需要title,可以在程序中设置无title的屏幕!转载请标明出处: http://blog.csdn.net/wdaming1986/article/details/6769821 程序的效果图: 代码说明一切真理: 一.mainActivity.java类得代码: Java代码 pac

VC++获取屏幕大小第二篇 物理大小GetDeviceCaps 上

分享一下我老师大神的人工智能教程吧.零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!http://www.captainbed.net 上一篇<VC++获取屏幕大小第一篇像素大小GetSystemMetrics>中介绍了使用GetSystemMetrics函数来获取屏幕的像素大小,本篇将介绍使用GetDeviceCaps函数来获取屏幕的物理大小.下面来看看GetDeviceCaps函数的用法: 函数功能:用于得到被定义的系统数据或者系统配置信息 函数原型:获取一些

【转载】JS获取屏幕大小

前些日子需要给项目的弹窗上面罩,因为项目左侧是树形菜单,右侧嵌套的iframe ,iframe 的内容不是固定大小,那么,面罩的大小也就不是固定的 因此,用到了JQuery获取当前页面的窗口大小,于是百度了一下,在博客园另一个博主风飘零的博文http://www.cnblogs.com/lf6112/archive/2011/07/26/2117348.html找到方法,再次感谢,于是转载过来了,如有版权问题,欢迎原博主私信解决问题. 下面贴上代码: 屏幕分辨率为:screen.width*sc

js获取屏幕大小

<html><script>function a(){document.write("屏幕分辨率为:"+screen.width+"*"+screen.height+"<br />"+"屏幕可用大小:"+screen.availWidth+"*"+screen.availHeight+"<br />"+"网页可见区域宽:"

C# winform根据屏幕大小自动缩放

1  Form基类 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; using System.IO; u