none
Code to detect monitor size

    Question

  • How to detect monitor size(i.e. 15 inch, 18 inch, 24 inch, etc) from C#.Net 2005 Windows Application.
    • Changed type Harsh1 Friday, November 19, 2010 10:06 AM it is the question
    Friday, November 19, 2010 10:05 AM

Answers

All replies

  • MessageBox.Show( "Monitor Size:" +
      SystemInformation.PrimaryMonitorSize );
    
    WIll get you the resolution... Im not sure that there is a method that returns actual screen measurements, besides pixles..
    Friday, November 19, 2010 10:38 AM
  • Hi,


    Screen.PrimaryScreen.WorkingArea.Height And Screen.PrimaryScreen.WorkingArea.Width
    it returns Primary screens resolutions in pixel.
    And I think there is no way to measure Monitor Display Size.

    Friday, November 19, 2010 11:56 AM
  • You can't. Because the size of the monitor is dependant on the dot pitch (which windows does not recover, it only outputs image data through it's cord), it will vary on each monitor's DPI.

    For a more elaborate explanation, check this thread:

    http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/314a4e86-6d9b-4e76-8f09-6978f29b9818

     

    Regards,

    Fábio


    "To alcohol! The cause of and solution to all of life's problems." - Homer Simpson
    • Marked as answer by Jing0Moderator Thursday, November 25, 2010 3:43 AM
    Friday, November 19, 2010 6:19 PM