Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resolution of the current monitor

Tags:

c#

winforms

How does one get the screen resolution of the current monitor? By "current monitor", I mean the one that the application starts on.

The reason I ask this is because I have two monitors, the secondary monitor is 1280x1024 and the primary is 1680x1050. The application, when it starts, stupidly sets its own height and width based on the primary monitor resolution. When the application launches on the secondary monitor, it overflows the resolution, which looks strange.

I know I could change/remove the code that sets the application's height/width, but I am also curious how one determines which monitor the application is showing on.

For what it's worth, I am not a proponent of applications that set their own height/width.

like image 784
kevin628 Avatar asked Jun 25 '12 15:06

kevin628


People also ask

What is screen resolution monitor?

Screen resolution Monitor, Telivision, Mobile device or any display device is the number of pixels in x and y dimensions. The Screen resolution is generally measured as width x height in pixels. For example resolution 1920 x 1080 means the 1920 pixels is width and 1080 pixels is height of the screen.

How to find the monitor resolution in Windows 10?

Windows 10 users should follow the below steps to find the monitor resolution. Press the “Start key + I” shortcut. Select “System.” Select “Display” on the sidebar. You will see the current display resolution under the “Display resolution” section. Your actual screen resolution is labeled with the “recommended” tag in the dropdown menu.

What is the native resolution of a monitor?

This native resolution indicates the maximum number of pixels it can accommodate when displaying an image. For example, a Full HD monitor has a native resolution of 1920x1080, i.e. it supports a maximum of 1920 horizontal pixels and 1080 vertical pixels.

How many pixels are in a monitor?

That means any full HD resolution monitor you come across has 1,920 pixels horizontally and 1,080 pixels vertically. Also in modern-day monitors, there are some popular ratios of resolution widely available on the market. Some of the most popular screen resolutions are is720p, 1080p, 1440p, 2K, and 4K.


Video Answer


1 Answers

Use Screen.FromControl:

Screen.FromControl(this).Bounds

where this is the Form that you want to retrieve the Screen information for.

like image 177
Evan Mulawski Avatar answered Oct 26 '22 23:10

Evan Mulawski