获取屏幕的分辨率,无非就是想实现全屏功能,XAML语言下,只修改一下window的几个属性就可以实现了。。
AllowsTransparency="True" //允许透明度
WindowStartupLocation="CenterScreen" //窗体运行时居中
WindowState="Maximized" //窗体运行时最大化
WindowStyle="None" //窗体风格不要,就是标题栏隐藏至于获取屏幕高度和宽度的值,暂时还没有找到答案。

解决方案 »

  1.   

    System.Windows.Forms.Screen   screen=Screen.PrimaryScreen;   
      System.Drawing.Rectangle   rct=screen.Bounds;   
      this.label1.Text=rct.Height.ToString();//高度   
      this.label2.Text=rct.Width.ToString();//宽度
      

  2.   

    WPF下没有Screen这个属性,所以不行的。正在找答案中---------------------
      

  3.   

    正确的答案:
    double h = SystemParameters.PrimaryScreenHeight;
    double w = SystemParameters.PrimaryScreenWidth;