如何确定我的Winform所在的监视器? [英] How do I determine which monitor my winform is in?

查看:78
本文介绍了如何确定我的Winform所在的监视器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个网站上走来走去,在Screen类上找到了很多信息,以及如何计算监视器的数量等等,但是如何确定表单当前处于哪个监视程序中呢?

I have been up and down this site and found a lot of info on the Screen class and how to count the number of monitors and such but how do I determine which montitor a form is currently in?

推荐答案

一个比使用界限更简单的方法是使用Screen.FromControl()方法。这与Windows使用的功能相同。

A simpler method than using the bounds is to use the Screen.FromControl() method. This is the same functionality that Windows uses.

Screen.FromControl(this)

将返回包含大多数调用表单的屏幕的屏幕对象。

will return the screen object for the screen that contains most of the form that you call it from.

这篇关于如何确定我的Winform所在的监视器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆