How do I find what screen the application is running on in C#

前端 未结 5 583
一生所求
一生所求 2020-12-11 06:05

How do I determine what screen my application is running on?

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-11 07:08

    The System.Windows.Forms.Screen class provides this functionaility.

    For example:

    Screen s = Screen.FromPoint(p);

    where p is a Point somewhere on your application (in screen coordinates).

提交回复
热议问题