2012-10-10 86 views
15

Duplicar posibles:
How to retrieve the Screen Resolution from a C# winform app?al obtener el tamaño en píxeles de la pantalla en ventanas forman en C#

¿Cómo puedo obtener el tamaño de la pantalla de formas de Windows?

+0

Ver aquí: http://stackoverflow.com/questions/2402739/how-to-retrieve-the-screen-resolution-from-ac-sharp -winform-app –

+0

[Esto tiene ambos] (http://stackoverflow.com/questions/254197/how-can-i-get-the-active-screen-dimensions) la solución WinForms y WPF –

Respuesta

27

Comprobar la Screen clase y su propiedad bounds

Screen.PrimaryScreen.Bounds.Width; 
Screen.PrimaryScreen.Bounds.Height; 
Screen.PrimaryScreen.Bounds.Size; 
+10

PRECAUCIÓN: En un MULTIPLE El sistema MONITOR, lo que en cambio podría querer saber es el tamaño de la pantalla EN QUE SE ENCUENTRA UNA FORMA ESPECÍFICA. Para esto, use Screen.FromControl (myForm). Consulte http://stackoverflow.com/questions/2402739/how-to-retrieve-the-screen-resolution-from-ac-c-sharp-winform-app para obtener más detalles. – ToolmakerSteve

+0

para sistema de pantalla múltiple. uno podría obtener la pantalla que contiene la mayor parte del formulario principal desde la forma principal de la aplicación como: Screen.FromControl (this) .WorkingArea; – gg89

Cuestiones relacionadas