Problem with usercontrol scaling when added at run-time in .Net, WinForms
- by Jules
First here's the steps to replicate, then I'll explain what the problem is:
(1) Add a usercontrol to a form in the construtor, after the InitializeComponent call.
(2) Run the form.
(3) Click a button to increase the form font size.
All the controls within the usercontrol scale perfectly but the usercontrol itself doesn't. It's width and height are increased by way too much.
To correct the problem, the usercontrol must be added before the InitializeComponent call.
If it wasn't possible for me to add the usercontrol before InitializeComponent, is there any way for me to correct the scaling?