Click here to Skip to main content
15,906,106 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Respected all,

I would like to make application in Windows Forms that should be resolution independent using C# as language.

I would like the code to make my program screen resolution independent.
Forms, buttons, font, etc will look the same size for different screen resolutions (i.e 800 x 600, 1024 x 768, 1280 x 1024.
Posted
Updated 14-Nov-11 23:27pm
v3
Comments
Mehdi Gholam 15-Nov-11 5:19am    
And your question is?
[no name] 15-Nov-11 5:27am    
My quetions is????

I am making a windows desktop application. The main problem I am facing is that its GUI affects adversely system resolution is changed. Can any body tell me how can i make resolution independent application?

Have a look at these Google[^] results.
The first one is a knowledge base from Microsoft: How To Create a Resolution-Independent Form[^].
 
Share this answer
 
Comments
[no name] 15-Nov-11 5:59am    
Thanks Andre..
But i want resolution independent only and only using anchor and dock property....
i had taken tabelpanel in my winform then take some controls inside tabelpanel...... then specify anchor propperties to all the controls...
...But when i change resolution of my pcto 1280*768 then controls and there respective fonts are shrinks......If there is other way to do without using Scale ratio as u specified in your link.....
 
Share this answer
 
Comments
[no name] 16-Nov-11 5:46am    
i want demo of ur application if u have done then please.. i have set anchor properties ..But for resizing the controls i have to calculate aspect ratio of both cureent and design time resolution respectively but i want to avoid it is there any another logic only using dock and anchor property ....What should i do if for font sizes...of controls...
Sergey Alexandrovich Kryukov 16-Nov-11 5:52am    
This approach is the best. Why would you need to change font size? Think about it? A person sits at the screen at the same distance, but see bigger screen at bigger angle. Fonts should remain the same, because this is just about visibility, the user only see more letters at a time.

Samples? Please download any of the UI code samples from any of my articles. They are built in a one-click manner, so you won't waste to much time. You will see.
--SA
[no name] 16-Nov-11 6:02am    
Thanks For you Reply sir...
please have a checkk out...make any windows application at 1024*768 taking 2 0r 3 controls...now try to change the resolution 1280*960 ...waht should happen...controls are smaall in size and alsio font size ...But my question is i want to make such application ...what i have make winform at design time that should be same display(font,control size.. etc)at higher or lower resolution...using Dock and Anchor property....or any other way without calculating aspect ratio....
Sergey Alexandrovich Kryukov 17-Nov-11 11:33am    
The idea is essentially resizeable window/form. If you test it using high screen resolution and it behaves well as you size it down to some reasonable extent, it gives you the idea how it can look at lower resolutions.
--SA
C#
this.Width = Screen.PrimaryScreen.WorkingArea.Width/2;
       this.Height = Screen.PrimaryScreen.WorkingArea.Height/2;
       this.Top = (Screen.PrimaryScreen.WorkingArea.Top + Screen.PrimaryScreen.WorkingArea.Height)/4;
       this.Left = (Screen.PrimaryScreen.WorkingArea.Left + Screen.PrimaryScreen.WorkingArea.Width)/4;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900