C# Identfiy screens number?

时间秒杀一切 提交于 2019-12-10 21:18:31

问题


How to have a function in C# to run the window identification, which will show the numbers 1, 2, ... on the screen same way as we do it by right click on the screen (properties) then we go to Screen Resolution and show the numbers by clicking on Identify.

Can we do that in C#?


回答1:


Yes, look at the Screen class: http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.aspx

You can get a list of all screens through Screen.AllScreens.




回答2:


Using the Screen.AllScreens Property does get an array of the monitors attached to the system.

Then Screen.DeviceName Property will give you it's name. However, that might not be the same as the number as the MSDN warns:

This string may contain non-printable characters.

I'd check this first to see if this gives you what you need.



来源:https://stackoverflow.com/questions/3776752/c-sharp-identfiy-screens-number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!