AutoScaling WinForm Display (Small, Medium)

Alex picture Alex · Apr 25, 2013 · Viewed 14.9k times · Source

First and foremost, please forgive me but my screenshots are in French due to my Windows installation at work. It is still very easy to understand though. I'll include screenshots to make it more visually appealing.

Here's some background information:

  • Windows 7 64bit
  • Visual Studio 2010
  • Default display is 100%
  • AutoScaleMode: DPI
  • AutoSize: True

Form properties

My application is a windows form that was developped in a default (small - 100%) display. Like so: Small (default) display

As you can see, the "Petite" or Small display is the default selection.

Small Display - 100% (default)

Here is how my application looks with this setting. This is the correct display Perfect display

Medium Display - 125%

The red rectangles point out the unwanted empty space. Display at Medium or 125 percent

I have tried:

  • Anchoring / Docking my controls such as my split containers, table layout panels, list views on Form_Load and via the UI. This didn't work.
  • Adding a split container to the form, and all controls respectively separated into it
  • Adding Table layout panels, where all textboxes and buttons are located in their respective cells

I really thought it was having a scaling problem because of the anchoring and docking. Although that didn't seem to be the problem ... What seems to be having trouble is the Tab Control and Listviews ...

Some users (most) have their settings as the default (100%) but there are a few who have it at a Medium setting, causing this scaling issue. Is there a way to fix this?

Answer

tsiorn picture tsiorn · Apr 25, 2013

I cant see your screenshots or links for some reason so I cannot visualize the problem. If scaling is the problem, try setting AutoScaleMode to None.

I recently had to do this because my winform app was image intensive and it would not render correctly on Medium Settings because I built it using the default Small Settnigs display. Changing scale mode to None worked for me.