110,530
社区成员
发帖
与我相关
我的任务
分享
if (!page.Shown)
{
// Special testing needed for Forms
Form f = c as Form;
// AutoScaling can cause the Control/Form to be
if ((f != null) && (f.AutoScale))
{
// Workaround the problem where a form has a defined 'AutoScaleBaseSize' value. The
// first time it is shown it calculates the size of each contained control and scales
// as needed. But if the contained control is Dock=DockStyle.Fill it scales up/down so
// its not actually filling the space! Get around by hiding and showing to force correct
// calculation.
c.Show();
c.Hide();
}
// Only need extra logic first time around
page.Shown = true;
}