I've searched everywhere and I haven't been able to find a way to
change the screen resolution in the .NET framework without using the
old Win32 API calls and writing unmanaged code -- the old Win32 API
function names are ChangeDisplaySettings() and
ChangeDisplaySettingsEx(). Without using the Win32 API, however, it
doesn't seem to be possible to change the screen resolution.
I've found several examples of using the Screen class to get the
screen resolution, and I've found examples on how to receive
notification when the user changes the screen resolution via the
DisplaySettingsChanged event, but I haven't found a way to actually
set the resolution in code through the .NET framework.
Any ideas?
NOTE: I don't want this to turn into a war over whether a program
running on any users computer should or should not change the screen
resolution. My purpose here is to write an application that changes
the screen resolution when a user logs on to the computer, and this
screen resolution would be a preference that the user has set. The
current version of Windows doesn't support saving the screen
resolution as a user preference.
-- Brad Cupit -----------------
The e-mail address listed for
me is a no-spam address so
please respond to the group
rather than my address. Thanks!
-------------------------------
Dmitriy Lapshin [C# / .NET MVP] - 15 Dec 2003 13:21 GMT
Hi Brad,
I'm afraid changing the screen resolution can be done only by resorting to
the unmanaged API.

Signature
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
> I've searched everywhere and I haven't been able to find a way to
> change the screen resolution in the .NET framework without using the
[quoted text clipped - 25 lines]
> rather than my address. Thanks!
> -------------------------------