Hi,
My machine in windows-7 & Screen resolution is (1366 * 768) Highly recommended.
float height = SystemInformation.VirtualScreen.Height;
float width = SystemInformation.VirtualScreen.Width;
double diagonal = Math.Sqrt(width * width + height * height); The above code I have used to get width and height of the screen to calculate diagonal in windows application. But the problem here is when I change the resolution width and height also gets change. So I need a piece of code that should read height and weight to calculate diagonal size.
Please post solution for this post.
Thanks in Advance.

Nitesh KejriwalRank #253 · 9.9K reputationPosted Sep 4, 2014, 11:43 PM EDT
Rajkumar R175 reputationPosted Sep 5, 2014, 1:31 AM EDT
I have used System.Windows.Forms.Screen.PrimaryScreen.Bounds;
And
Even this code "Screen.PrimaryScreen.Bounds.Width & Screen.PrimaryScreen.Bounds.Height " returns height and width based on screen resolution.
Nitesh KejriwalRank #253 · 9.9K reputationPosted Sep 5, 2014, 4:54 AM EDT
Rajkumar R175 reputationPosted Sep 7, 2014, 11:03 PM EDT
shahid wani29 reputationPosted Feb 24, 2021, 4:46 AM EST