Here is how to do it in
. As you don't have to actually create any form or application with this code, you can also use it in WPF.
to get all your screens of the same type
. If you need only you primary screen, get just
. Look at the properties of each screen. In particular, you can use
How to set screen resolution?!!
No, you cannot. Come on, you cannot have such requirement. Just the opposite, you have to write resolution-independent software. If you have requirements for the sizes of the windows, you can develop the UI the way it looks on the higher-resolution screen exactly as the same application on the base minimally required resolution. That's why you don't need to set resolution but only get it.
(I hope you understand that you cannot set resolution higher that it is physically possible no matter how strongly it is required :-).)