Closed rqsanderson closed 4 years ago
Hi @rqsanderson, thanks for reporting. Will look into it.
After a short investigation the rescaling is not related to the IconPictureBox but all Windows Forms items that initialize the font resources. For instance, instantiating an IconPictureBox
or an IconButton
has the same effect as described above.
The setting of AutoScaleMode
on the main form does not seem to have any effect on this.
Probably related to DPI virtualization, cf.:
On Windows 10 (.NET 4.7+) you can enable DPI awareness in your windows forms application by adding
<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2" />
</System.Windows.Forms.ApplicationConfigurationSection>
to your app.config
. For more information see
@rqsanderson Closing this issue since a workaround exists.
When an IconPictureBox is instantiated on a form in a WinForms application, it reduces the display scale of the ENTIRE application to the Windows out-of-the-box standard 96 dpi. This is a rather annoying issue for users who prefer to run at a higher logical dpi.
To reproduce, make sure your system settings are as follows, before running your application:
System: Windows 10 System fundamental dpi: 96 Monitor scaling: 125% (120 dpi) App forms are set to AutoScaleMode = Font
When you run your application, as soon as an IconPictureBox is instantiated with new in the designer file's InitializeComponent method, the application will immediately shrink to the system dpi for the remainder of the time the application is running.