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

Amr Ashraf

Member
Joined
Apr 5, 2022
Messages
14
Programming Experience
Beginner
<div class="bbWrapper">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 .<br /> 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 :<br /> <br /> Design Mode<br /> <br /> <br /> <script class="js-extraPhrases" type="application/json"> { "lightbox_close": "Close", "lightbox_next": "Next", "lightbox_previous": "Previous", "lightbox_error": "The requested content cannot be loaded. Please try again later.", "lightbox_start_slideshow": "Start slideshow", "lightbox_stop_slideshow": "Stop slideshow", "lightbox_full_screen": "Full screen", "lightbox_thumbnails": "Thumbnails", "lightbox_download": "Download", "lightbox_share": "Share", "lightbox_zoom": "Zoom", "lightbox_new_window": "New window", "lightbox_toggle_sidebar": "Toggle sidebar" } </script> <div class="bbImageWrapper js-lbImage" title="RGAi5.png" data-src="https://csharpforums.net/attachments/rgai5-png.2162/" data-lb-sidebar-href="" data-lb-caption-extra-html="" data-single-image="1"> <img src="https://csharpforums.net/attachments/rgai5-png.2162/" data-url="" class="bbImage" data-zoom-target="1" style="" alt="RGAi5.png" title="RGAi5.png" width="1389" height="785" loading="lazy" /> </div><br /> <br /> <br /> Debug mode 43 Inches screen :<br /> <br /> <div class="bbImageWrapper js-lbImage" title="FCYWy.png" data-src="https://csharpforums.net/attachments/fcywy-png.2163/" data-lb-sidebar-href="" data-lb-caption-extra-html="" data-single-image="1"> <img src="https://csharpforums.net/attachments/fcywy-png.2163/" data-url="" class="bbImage" data-zoom-target="1" style="" alt="FCYWy.png" title="FCYWy.png" width="916" height="518" loading="lazy" /> </div><br /> <br /> <br /> Form properties :<br /> <br /> PanelMenu<br /> <br /> <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code language-csharp " data-xf-init="CMTV-code-block"> <div class="bbCodeBlock-header"> <div class="bbCodeBlock-title"> <span title=""> C#: </span> </div> <div class="bbCodeBlock-actions"> <i class="fa--xf far fa-expand-alt action action--expand action--hidden"><svg xmlns="http://www.w3.org/2000/svg" role="img" data-xf-init="tooltip" data-xf-click="CMTV-code-block-expand"><title>Expand</title><use href="/data/local/icons/regular.svg?v=1757593269#expand-alt"></use></svg></i> <i class="fa--xf far fa-compress-alt action action--collapse action--hidden"><svg xmlns="http://www.w3.org/2000/svg" role="img" data-xf-init="tooltip" data-xf-click="CMTV-code-block-collapse"><title>Collapse</title><use href="/data/local/icons/regular.svg?v=1757593269#compress-alt"></use></svg></i> <i class="fa--xf far fa-paste action action--copy"><svg xmlns="http://www.w3.org/2000/svg" role="img" data-xf-init="tooltip"><title>Copy</title><use href="/data/local/icons/regular.svg?v=1757593269#paste"></use></svg></i> </div> </div> <div class="bbCodeBlock-content" dir="ltr"> <pre class="bbCodeCode line-numbers" dir="ltr" data-line="" data-xf-init="CMTV-code-block-extend" data-lang="csharp"><code>Dock Left Size 231, 687</code></pre> </div> <div class="bbCodeBlock-grip resizer--hidden" data-xf-init="CMTV-code-block-resizer"> <i class="fa--xf far fa-grip-horizontal "><svg xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" ><use href="/data/local/icons/regular.svg?v=1757593269#grip-horizontal"></use></svg></i> </div> </div><br /> Buttons<br /> <br /> <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code language-csharp " data-xf-init="CMTV-code-block"> <div class="bbCodeBlock-header"> <div class="bbCodeBlock-title"> <span title=""> C#: </span> </div> <div class="bbCodeBlock-actions"> <i class="fa--xf far fa-expand-alt action action--expand action--hidden"><svg xmlns="http://www.w3.org/2000/svg" role="img" data-xf-init="tooltip" data-xf-click="CMTV-code-block-expand"><title>Expand</title><use href="/data/local/icons/regular.svg?v=1757593269#expand-alt"></use></svg></i> <i class="fa--xf far fa-compress-alt action action--collapse action--hidden"><svg xmlns="http://www.w3.org/2000/svg" role="img" data-xf-init="tooltip" data-xf-click="CMTV-code-block-collapse"><title>Collapse</title><use href="/data/local/icons/regular.svg?v=1757593269#compress-alt"></use></svg></i> <i class="fa--xf far fa-paste action action--copy"><svg xmlns="http://www.w3.org/2000/svg" role="img" data-xf-init="tooltip"><title>Copy</title><use href="/data/local/icons/regular.svg?v=1757593269#paste"></use></svg></i> </div> </div> <div class="bbCodeBlock-content" dir="ltr"> <pre class="bbCodeCode line-numbers" dir="ltr" data-line="" data-xf-init="CMTV-code-block-extend" data-lang="csharp"><code>Size 231, 60 Dock Top FlatStyle Flat ImageAlign MiddleLeft TextAlign MiddleLeft TextImageRelation ImageBeforeText</code></pre> </div> <div class="bbCodeBlock-grip resizer--hidden" data-xf-init="CMTV-code-block-resizer"> <i class="fa--xf far fa-grip-horizontal "><svg xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" ><use href="/data/local/icons/regular.svg?v=1757593269#grip-horizontal"></use></svg></i> </div> </div><br /> Thanks in advance.</div>
 
<div class="bbWrapper">I&#039;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.<br /> <br /> Some of the tricks you can apply is to take advantage of autosizing, and the stack panel and table layout panels.</div>
 
<div class="bbWrapper"><blockquote data-attributes="member: 11639" data-quote="Skydiver" data-source="post: 29712" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch"> <div class="bbCodeBlock-title"> <a href="/goto/post?id=29712" class="bbCodeBlock-sourceJump" rel="nofollow" data-xf-click="attribution" data-content-selector="#post-29712">Skydiver said:</a> </div> <div class="bbCodeBlock-content"> <div class="bbCodeBlock-expandContent js-expandContent "> I&#039;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.<br /> <br /> Some of the tricks you can apply is to take advantage of autosizing, and the stack panel and table layout panels. </div> <div class="bbCodeBlock-expandLink js-expandLink"><a role="button" tabindex="0">Click to expand...</a></div> </div> </blockquote><br /> Thanks for reply , I realized something if I changed the DPI of the big screen it helps ( Current DPI is 150%) I think that&#039;s the issue.</div>
 
<div class="bbWrapper">Check the documentation. I think that WinForms also has some settings to deal with High DPI.</div>
 
Back
Top Bottom