zoukankan      html  css  js  c++  java
  • winform,wpf,winrt获取屏幕分辨率

    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;  

    wpf

    double width= SystemParameters.PrimaryScreenWidth;

    double height = SystemParameters.PrimaryScreenHeight;

    winrt

    double width = CoreWindow.GetForCurrentThread().Bounds.Width;

    double height = CoreWindow.GetForCurrentThread().Bounds.height;

    官方的回复:http://social.msdn.microsoft.com/Forums/zh-CN/a376a37b-f7d6-4d05-aa8e-75768e2f12b7/win8?forum=winstoreappzhcn

  • 相关阅读:
    H3C S3600-28TP-SI配置命令
    笔记本双网卡内外同上
    计算机存储单位与宽带单位
    linux 设置网卡
    linux 挂载命令详解
    vue实现京东动态楼层效果
    js字符与ASCII码互转的方法
    UartAssist串口调试工具
    高字节和低字节是什么意思?
    int16, int32, int64等类型说明
  • 原文地址:https://www.cnblogs.com/wangjinming/p/3899295.html
Copyright © 2011-2022 走看看