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

  • 相关阅读:
    59、web框架以及Django框架
    58、bootstrap
    56、jQuery事件
    55、原生js事件与jQuery
    36-并发编程
    4.20---远程执行命令的CS架构软件
    35-socket 基于套接字的TCP与UDP
    34-网络编程
    33-异常处理
    4.15---元类练习
  • 原文地址:https://www.cnblogs.com/wangjinming/p/3899295.html
Copyright © 2011-2022 走看看