Problem with usercontrol scaling when added at run-time in .Net, WinForms
Posted
by Jules
on Stack Overflow
See other posts from Stack Overflow
or by Jules
Published on 2010-04-02T14:40:25Z
Indexed on
2010/04/02
14:43 UTC
Read the original article
Hit count: 317
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?
© Stack Overflow or respective owner