Click here to Skip to main content
15,796,456 members
Please Sign up or sign in to vote.
4.78/5 (6 votes)
See more:
hallo is it possible to fetch the actual native resolution or the resolution ratio of a LCD display attached to the system?

Eg.: i'd want my application to adapt differently if the LCD display is a 4:3 or a 16:9, etc., independently from the Windows' resolution
Thanks!
Posted

Try the following code, this is vary simple:

C#
private void GetCurrentScreenResolution()
{
    int intDeskHeight = Screen.PrimaryScreen.Bounds.Height;
    int intDeskWidth = Screen.PrimaryScreen.Bounds.Width;
    MessageBox.Show("Your screen resolution is " + intDeskWidth + "x" + intDeskHeight);

}



NOTE: Thanks to Mika Wendelius, the above code is implement from your suggestion.
 
Share this answer
 
You could use System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size.

 
Share this answer
 
Try to use WMI class Win32_DesktopMonitor.
 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900