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

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

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

5条回答
  •  时光说笑
    2020-12-11 07:10

    Well, many years have passed, and it is derivative of the accepted answer, but this worked for me. This method is a member of the Form class. The screen variable contains the properties of the screen that the upper left corner of the form is on when the method is called.

    private void ClsFormFoo_Load(object sender, EventArgs e)
    {
        Screen screen = Screen.FromControl(this);
    }
    

提交回复
热议问题