首页 > 技术文章 > 常识

lizhenlin 2016-10-17 20:38 原文

获取屏幕宽高

  private double ScreenHeight = SystemParameters.PrimaryScreenHeight;
  private double ScreenWidth = SystemParameters.PrimaryScreenWidth;

设置窗口为屏幕宽高

    Rect rc = SystemParameters.WorkArea;//获取工作区大小  
    this.Left = 0;//设置位置  
    this.Top = 0;
    this.Width = rc.Width;
    this.Height = rc.Height;

 

推荐阅读