110,534
社区成员
发帖
与我相关
我的任务
分享
private void setfrom(Control.ControlCollection IControls)
{
foreach (Control item in IControls)
{
item.Top = (int)(item.Top * 0.8);
item.Left = (int)(item.Left * 0.8);
item.Width = (int)(item.Width * 0.8);
item.Height = (int)(item.Height * 0.8);
if (item.HasChildren)
{
setfrom(item.Controls);
}
}
}
这是个缩小到80%的方法,你自己写参数做成缩小指定倍数的即可。