Retrieve the current screen resolution

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
C# Code Snippets

C# Source Code Bank

See also …
edit

This C# code snippet allows the user to retrieve the users current screen resolution.

You can output the dimensions, in pixels, of the current video mode of the primary display to a messagebox using the following code.

MessageBox.Show( "Monitor Size:" +
   SystemInformation.PrimaryMonitorSize );

Alternatively, you can get the bounds of the virtual screen.

MessageBox.Show( "VirtualScreen: " +
   SystemInformation.VirtualScreen );

MSDN references


Today's Deals: Electronics

Personal tools