If you have ever tried to personalize your Windows 7 desktop and chose to zoom to 125%, as per the following screenshot, you’ll perhaps notice that some applications do not display so well:
Believe it or not, the 125% or 150% zoom mode does not simply decrease the dpi of the display and make it look bigger, unlike the advanced display settings in Windows XP:
In fact, when the 125% or 150% zoom mode is set, Windows 7 does (at least) the following two things:
- Increase the default font size
- Tell every window (including child window) to increase its size
It’s up to the application to handle the change in font size and window size gracefully. If it does not, the application interface may look distorted, with text truncated or displayed outside its designated area and graphics being tiled up or stretched.
Interestingly the 125% or 150% zoom mode cannot be used during a Remote Desktop session.
Effects on .NET forms
Under 125% or 150% zoom, the size of a .NET form will increase proportionally. The following changes will have to be made for the form to display properly:
- All form controls should have their Anchor property set appropriately.
- Most importantly, the AutoScaleMode property of every form should be set to Dpi and not Font. AutoScaleMode of user controls can be set to either Dpi or Inherit.
If set inappropriately, only the form will resize while the controls do not resize, causing display distortion.
Also, do not open the form designer from inside Visual Studio 2008 under 125% or 150% zoom mode. Otherwise, Visual Studio will “zoom” the form (perhaps in an attempt to obey the Windows settings faithfully) by increasing its Size property and forgets (or is unable) to restore the original size when the zoom mode is set to 100%. If this happens, you’ll have to manually resize every form back to their original size.
I am not sure if it’s a Visual Studio bug, or it’s just supposed to be that way.