change the resolution of the system by programatically  
Author Message
Maheswari





PostPosted: Visual C# General, change the resolution of the system by programatically Top

My system is having 1152 * 864 pixel resolution environments. Here I am developing an application and its working fine.

Whereas in another machine is having 1024*758 pixel resolution. In this resolution some of the UI controls are invisible.

Can anyone help me to work my application in any resolution, with out doing anything manually




Visual C#11  
 
 
TaylorMichaelL





PostPosted: Visual C# General, change the resolution of the system by programatically Top

I assume then that you are probably creating a form that is bigger than 1024*768. In this case when it is displayed on a 1024x display some of the controls will be clipped. You should develop your forms so they fit in a 1024x pixel display. This should resolve the display issues.

Michael Taylor - 12/11/06


 
 
James Curran





PostPosted: Visual C# General, change the resolution of the system by programatically Top

It's unclear what you are asking for, as the title of your message asks one thing, and the body asks another.

First of all, do NOT attempt to change the resolution of the display to run your program.  The display resolution is the user's decision, not yours, and changing it is extremely rude.  It's the type of thing where if it happened to me, I'd be tempted to just exist out of the app, delete it from my system, and never look back.

If you need 1152x864 for your application, then you definitely need to reconsider your screen layout.  You are putting too much information to the user at one time. 

Also you should look into the Anchor property on WinForms controls.  It allows you to easily adjust the layout of the control to the size of the form.



 
 
Angel Kafazov





PostPosted: Visual C# General, change the resolution of the system by programatically Top

To change the resolution you can call the ChangeDisplaySettingsEx Windows API, I don't know if it is exposed in .NET.