[C#] How to get screen resolution/width/height?

It’s just a matter of using this one line of code:

var screen = System.Windows.Forms.Screen.PrimaryScreen.Bounds;
var width  = screen.Width;
var height = screen.Height;

A quick noted post for later use since a google search on this topic not giving you the full answer right a way.

Advertisements

2 responses to this post.

  1. Posted by Ram on January 17, 2012 at 12:25 PM

    Thanks..

    Reply

  2. Posted by mahesh on November 16, 2012 at 5:50 PM

    getting an error at System.Windows

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: