#region panel生成上的控件缩放
public void AutoScalePanel(Panel panel)
{
panel.Tag = panel.Width.ToString() + "," + panel.Height.ToString();
panel.SizeChanged += new EventHandler(panelSizechanged);
}
private void panelSizechanged(object sender, EventArgs e)
{
String[] tmep = ((Panel)sender).Tag.ToString().Split(',');
float w = (float)((Panel)sender).Width / (float)Convert.ToInt16(tmep[0]);
float h = (float)((Panel)sender).Height / (float)Convert.ToInt16(tmep[1]);
((Panel)sender).Tag = ((Panel)sender).Width.ToString() + "," + ((Panel)sender).Height;
foreach(Control control in ((Panel)sender).Controls){
control.Scale(new SizeF(w,h));
}
}
#endregion