简体   繁体   中英

C# Identfiy screens number?

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#?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM