How to set the windows screen resolution using c# windows application

c#

Solution

As the others already mentioned you shouldn't change the resolution automatically, cause the user set it to a specific resolution he likes (or his hardware works best on).

So instead of changing the resolution you should change your application. Use TableLayoutPanel, FlowLayoutPanel and / or SplitContainer. Set the Anchor and Dock properties of your Controls and think about setting the MinimumSize and MaximumSize of each control within your application.

This way your application can automatically scale between different resolutions and the user can take the one he likes.

Last but not least, your application should not only consider to take care about the resolution the user selected, it should also take care about the selected dpi settings. Which one you should care of are described in the Windows UX Guide (site 592).

Problem

I have done a project in c# winforms. I want to set the resolution of the screen to 1680 x 1050, when the application is run in any pc. How to do it ?

Original source

Related problems