Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / December 2003

Tip: Looking for answers? Try searching our database.

Is it possible to change the screen resolution in the .NET framework?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brad Cupit - 11 Dec 2003 16:59 GMT
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!
> -------------------------------

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.