WinForm

int iActulaWidth = Screen.PrimaryScreen.Bounds.Width;

int iActulaHeight = Screen.PrimaryScreen.Bounds.Height ;

 

WPF下的:

double dWidth = System.Windows.SystemParameters.PrimaryScreenWidth;

double dHeight = System.Windows.SystemParameters.PrimaryScreenHeight;

double dWidth2 = ActualWidth; //获取此元素的呈现宽度。若此元素时全屏的,则可以获得屏幕大小(-_-!!!)

double dHeight2 = ActualHeight; //获取此元素的呈现高度。

相关文章:

  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2021-09-15
猜你喜欢
  • 2021-05-23
  • 2021-08-15
  • 2022-02-07
  • 2021-07-03
  • 2021-10-02
相关资源
相似解决方案