This problem happens to me when I change the Scale and layout in windows Settings->System form 100% to a higher value. It probably has to do with high DPI and DPI scaling.
I found several solution:
Solution 1: Configuring Windows Forms for high DPI support
This solution is only for .NET Framework version 4.7 or higher.
Add this to to App.config file.
<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2" />
</System.Windows.Forms.ApplicationConfigurationSection>
Source: Configuring your Windows Forms app for high DPI support:
Enable per-monitor DPI awareness in the app.config file.
Windows Forms
introduces a new
System.Windows.Forms.ApplicationConfigurationSection element to
support new features and customizations added starting with the .NET
Framework 4.7. To take advantage of the new features that support high
DPI, add the following to your application configuration file.
<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2" />
</System.Windows.Forms.ApplicationConfigurationSection>
Important
In previous versions of the .NET Framework, you used the manifest to
add high DPI support. This approach is no longer recommended, since it
overrides settings defined on the app.config file.
Solution 2: Use Ookii.Dialogs.WinForms NuGet package
Use the Ookii.Dialogs.WinForms NuGet package. It doesn't have the shrinking problem. It has a VistaOpenFileDialog
similar to the CommonFileDialog
of WindowsAPICodePack. It also has a nice folder browser VistaFolderBrowserDialog
like the CommonFileDialog
with IsFolderPicker
set to true
.
Solution 3: Override high DPI scaling behavior for the .exe file
This solution requires to manually change the compatibility settings for each application .exe file individually, so it not the best solution.
To do this you need to right-click on the .exe file, select Properties->Compatibility->Change high DPI settings and check Override high DPI scaling behavior and select one of the options (see: How to use DPI scaling in Windows 10 to fix blurry old apps)
CommonOpenFileDialog
shrinks the entire window to what it would appear as if my scale was 100%. Unfortunately, my monitor is a TV screen and reducing the scale from 150% to 100% makes many things unreadable. Have you found a solution that can be done in the code? – Extra