运行在双屏幕环境下的应用 [英] run application on a dual screen environment

查看:213
本文介绍了运行在双屏幕环境下的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  <一href="http://stackoverflow.com/questions/549751/how-do-i-find-what-screen-the-application-is-running-on-in-c-sharp">How做我查找筛选应用程序是在C#运行

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

任何想法要检查在双屏幕环境当前的应用程序是否运行主屏幕上或不?我使用VSTS 2008 + C#+。NET 3.5的。我想补充code。在我的应用程序,以检测是否当前的应用程序运行的主屏幕上还是不行。

Any ideas to check whether current application is run on primary screen or not in a dual screen environment? I am using VSTS 2008 + C# + .Net 3.5. I want to add code in my application to detect whether current application is run on primary screen or not.

在此先感谢, 乔治

推荐答案

您可以使用屏幕类,它可以告诉你一个控件是否是一个特殊的屏幕上还是不行。您还可以得到初级的监察,每个屏幕对象也有一个主属性表明它是否是主要的监察。

You can use the Screen class which can tell you whether or not a control is on a particular screen or not. You can also get the primary monitory, and every Screen object also has a Primary property which indicates whether or not it is the primary monitory.

这里是 MSDN文章

您应该能够使用这样的:

You should be able to use it like this:

var monitor = Screen.FromControl(this);

if (monitor.Primary) //the monitor returned is the primary monitor

这篇关于运行在双屏幕环境下的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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