Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
I have a problem with winform C# windows.
I write code in laptop with display 15.6 inchs, my winform is full windows. But when I install this app in desktop 21 inchs, zoom windows, my app have many space is not used.
I can auto scale it? Adaptive with display's resolution?
Please help me. Thanks.
Posted
Updated 9-Jun-20 1:20am

We have even an article on that: "C# Resize ALL Controls at Runtime"[^].
And you may find many many results just Googling[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-Sep-15 13:54pm    
The technique your reference can be useful (a 5), but the whole problem is ill-posed, is stemmed from the wrong approach of using fixed layout, which is bad. Please see Solution 2.
—SA
Member 10390715 7-Sep-15 21:12pm    
Thanks for your help!
CPallini 8-Sep-15 2:22am    
You are welcome.
Wendelius 8-Sep-15 0:27am    
Good links, 5!
CPallini 8-Sep-15 2:23am    
Thank you.
Instead of "auto-scaling", you should better develop fluid layout which automatically adopts to any reasonable size of a form. Basically, get away from fixed layout, get rid of manual sizes and positions, layout everything based on the properties Dock and Padding. If it comes to the form which is typically bigger then the screen at its design size, you can start it as maximized. Please see my past answers:
Zom Out malfunctions when Screen resolution changes[^],
how to dock button so that it can adjust with the form[^] (see the rudimentary code sample here).

See also: GUI Apperance - C#.Net[^].

—SA
 
Share this answer
 
Comments
CPallini 7-Sep-15 14:02pm    
5.
Sergey Alexandrovich Kryukov 7-Sep-15 14:30pm    
Thank you, Carlo.
—SA
Member 10390715 7-Sep-15 21:22pm    
Thanks for help. I must learn more and more
Sergey Alexandrovich Kryukov 7-Sep-15 21:51pm    
That's a great attitude, one of the prerequisites to success. You are very welcome.
—SA
I recommend using TableLayoutPanel component.
 
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