How can I get my design to work on any screen size ?

Amr Ashraf

Member
Joined
Apr 5, 2022
Messages
14
Programming Experience
Beginner
Hello guys , I have designed a form and set the Dock and Anchor as i wanted , The problem is in the design mode the design is perfect but in the runtime he controls are not set properly .
I tried my design on the laptop and the result was great , But when i run it on my PC with screen 43 Inches the result as below :

Design Mode


RGAi5.png



Debug mode 43 Inches screen :

FCYWy.png



Form properties :

PanelMenu

C#:
Dock Left
Size 231, 687

Buttons

C#:
Size 231, 60
Dock Top
FlatStyle Flat
ImageAlign MiddleLeft
TextAlign MiddleLeft
TextImageRelation ImageBeforeText

Thanks in advance.
 
I'm general, WInForms was never designed for responsive UI. The old Win32 API approach was to always have extra space for text length in case the longer localized strings, and plan ahead for right-to-left text.

Some of the tricks you can apply is to take advantage of autosizing, and the stack panel and table layout panels.
 
I'm general, WInForms was never designed for responsive UI. The old Win32 API approach was to always have extra space for text length in case the longer localized strings, and plan ahead for right-to-left text.

Some of the tricks you can apply is to take advantage of autosizing, and the stack panel and table layout panels.

Thanks for reply , I realized something if I changed the DPI of the big screen it helps ( Current DPI is 150%) I think that's the issue.
 
Check the documentation. I think that WinForms also has some settings to deal with High DPI.
 
Back
Top Bottom