sikas
sikas

Reputation: 5523

Changing Screen Resolution

I have a C# WPF application, I want it, when launched, to change the screen resolution if it is not what it should work on, like the games.

I know how to retrieve the screen resolution, but I don`t know how to set it to what I want.

NOTE: I`m not working with ASP or WEB, just a desktop APP

Upvotes: 0

Views: 2619

Answers (2)

krb
krb

Reputation: 16345

This API function lets you change display settings:

        [DllImport("user32.dll")]
        static extern int ChangeDisplaySettings(
        ref DEVMODE devMode, int flags);

This article explains how to use this function

Upvotes: 2

abhishek
abhishek

Reputation: 2992

Why do you require this.

I think you should not do this, rather you can build the application within a ViewBox and which let you create Resolution Independent UI.

Please check my article : http://www.dotnetfunda.com/articles/article827-resolution-independent-ui-.aspx

Upvotes: 1

Related Questions