Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. The forms are cut for me using high resolution on WinForm

The forms are cut for me using high resolution on WinForm

Scheduled Pinned Locked Moved C#
csharpdotnetwinformscomquestion
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    goldsoft
    wrote on last edited by
    #1

    I got a new laptop with very high resolution. I increased the size text, apps and other to 150% i work on WinForm program using Visual-Studio 2019. All the forms in my program are cut and everything goes wrong on the screen. i try this: app.manifest app.config i work on .NET Framework 4.7.2 i also try this: https://docs.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8 and also this on the main of every form: (Each time something different) this.AutoScaleMode = AutoScaleMode.Font; this.AutoScaleMode = AutoScaleMode.Dpi; this.AutoScaleMode = AutoScaleMode.None; I have already tried everything .... and nothing helps. any idea ? thanks

    L D B 4 Replies Last reply
    0
    • G goldsoft

      I got a new laptop with very high resolution. I increased the size text, apps and other to 150% i work on WinForm program using Visual-Studio 2019. All the forms in my program are cut and everything goes wrong on the screen. i try this: app.manifest app.config i work on .NET Framework 4.7.2 i also try this: https://docs.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8 and also this on the main of every form: (Each time something different) this.AutoScaleMode = AutoScaleMode.Font; this.AutoScaleMode = AutoScaleMode.Dpi; this.AutoScaleMode = AutoScaleMode.None; I have already tried everything .... and nothing helps. any idea ? thanks

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If the size of the "controls" (on the forms) was fixed, "auto sizing" only the form makes no difference; everything has to be able to resize itself based on its container.

      It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

      G 1 Reply Last reply
      0
      • L Lost User

        If the size of the "controls" (on the forms) was fixed, "auto sizing" only the form makes no difference; everything has to be able to resize itself based on its container.

        It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

        G Offline
        G Offline
        goldsoft
        wrote on last edited by
        #3

        Thanks for the answer, so if I understood correctly, I need all the controls to be AutoSize = true ?

        L 1 Reply Last reply
        0
        • G goldsoft

          I got a new laptop with very high resolution. I increased the size text, apps and other to 150% i work on WinForm program using Visual-Studio 2019. All the forms in my program are cut and everything goes wrong on the screen. i try this: app.manifest app.config i work on .NET Framework 4.7.2 i also try this: https://docs.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8 and also this on the main of every form: (Each time something different) this.AutoScaleMode = AutoScaleMode.Font; this.AutoScaleMode = AutoScaleMode.Dpi; this.AutoScaleMode = AutoScaleMode.None; I have already tried everything .... and nothing helps. any idea ? thanks

          D Offline
          D Offline
          DerekT P
          wrote on last edited by
          #4

          Yep, Win10 is a pile of crap. If I size everything to 100%, it's so miniscule that it's totally unreadable (for me, in my more mature years). So I set magnification to 125%; most text is now readable, but some older apps remain unaffected. In MS Office most texts are fine, but the icons are absolutely tiny; fortunately I can generally remember the sequence, but otherwise I couldn't use Office apps. Most pop-up boxes from Windows are OK, but some - core Windows pop-ups - are the right size but their controls are misplaced, sometimes outside the boundary of the form. When this happens with an OK or CANCEL button the popup becomes unusable and I have to change the default Windows setting temporarily. Then there's a whole raft of applications - both Microsoft and 3rd party - where the text is displayed fuzzy and makes my eyes hurt to read it. All this, and it seems that 125% is the default for Win10 on my screen size / resolution. Windows 3.1 was better than this!

          1 Reply Last reply
          0
          • G goldsoft

            Thanks for the answer, so if I understood correctly, I need all the controls to be AutoSize = true ?

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            You prototype to see what works and what doesn't ... for "your" app. I'm not going to tell you to change "everything" to autosize. Sometimes you want something fixed size so you don't get a lot of empty space. IMO, the "secret" to Windows Forms "fluid" design is to make "everything" "dockable"; that's the basis for fluid design in XAML (wpf and uwp). Most Windows Forms (designers) use absolute positioning by default.

            It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

            1 Reply Last reply
            0
            • G goldsoft

              I got a new laptop with very high resolution. I increased the size text, apps and other to 150% i work on WinForm program using Visual-Studio 2019. All the forms in my program are cut and everything goes wrong on the screen. i try this: app.manifest app.config i work on .NET Framework 4.7.2 i also try this: https://docs.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8 and also this on the main of every form: (Each time something different) this.AutoScaleMode = AutoScaleMode.Font; this.AutoScaleMode = AutoScaleMode.Dpi; this.AutoScaleMode = AutoScaleMode.None; I have already tried everything .... and nothing helps. any idea ? thanks

              B Offline
              B Offline
              BillWoodruff
              wrote on last edited by
              #6

              I had similar problems until I set AutoScaleMode to Font. However, I have my 4k laptop screen set to 1920x1080 as well as 150% scaling ... I have vision problems.

              «One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali

              G 1 Reply Last reply
              0
              • B BillWoodruff

                I had similar problems until I set AutoScaleMode to Font. However, I have my 4k laptop screen set to 1920x1080 as well as 150% scaling ... I have vision problems.

                «One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali

                G Offline
                G Offline
                goldsoft
                wrote on last edited by
                #7

                I also have a laptop with 4K screen (3840X2160) 220% scaling and I also changed AutoScaleMode to Font. and still cut the screens in the my program

                B 1 Reply Last reply
                0
                • G goldsoft

                  I also have a laptop with 4K screen (3840X2160) 220% scaling and I also changed AutoScaleMode to Font. and still cut the screens in the my program

                  B Offline
                  B Offline
                  BillWoodruff
                  wrote on last edited by
                  #8

                  I think you can focus this discussion more by adding to your original post specific details: for example, you create a new WinForm project, size the main form to 800x600, set the StartPosition to 'CenterScreen. Drop Labels in each corner of the Form: then, run the project, and describe what you observe. You might also put this code in the main form Load event:

                  Rectangle r1 = Screen.PrimaryScreen.Bounds;
                  Rectangle r2 = this.Bounds;
                  Rectangle r3 = this.ClientRectangle;
                  Rectangle r4 = this.DisplayRectangle;

                  Console.WriteLine($"screen {r1}\nform bounds {r2}\nform displayrect {r3}\nform clientrect {r2}");

                  And, try varying the AutoScaleMode ... the goal being to identify the visually unexpected.

                  «One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali

                  1 Reply Last reply
                  0
                  • G goldsoft

                    I got a new laptop with very high resolution. I increased the size text, apps and other to 150% i work on WinForm program using Visual-Studio 2019. All the forms in my program are cut and everything goes wrong on the screen. i try this: app.manifest app.config i work on .NET Framework 4.7.2 i also try this: https://docs.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8 and also this on the main of every form: (Each time something different) this.AutoScaleMode = AutoScaleMode.Font; this.AutoScaleMode = AutoScaleMode.Dpi; this.AutoScaleMode = AutoScaleMode.None; I have already tried everything .... and nothing helps. any idea ? thanks

                    B Offline
                    B Offline
                    BillWoodruff
                    wrote on last edited by
                    #9

                    I think you can focus this discussion more by adding to your original post specific details: for example, you create a new WinForm project, size the main form to 800x600, set the StartPosition to 'CenterScreen. Drop Labels in each corner of the Form: then, run the project, and describe what you observe. You might also put this code in the main form Load event:

                    Rectangle r1 = Screen.PrimaryScreen.Bounds;
                    Rectangle r2 = this.Bounds;
                    Rectangle r3 = this.ClientRectangle;
                    Rectangle r4 = this.DisplayRectangle;

                    Console.WriteLine($"screen {r1}\nform bounds {r2}\nform displayrect {r3}\nform clientrect {r2}");

                    And, try varying the AutoScaleMode ... the goal being to identify the visually unexpected more clearly. Hope it helps !

                    «One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups