📜  如何在c#代码示例中设置图片框宽度和表单宽度

📅  最后修改于: 2022-03-11 14:49:04.900000             🧑  作者: Mango

代码示例1
private void Form1_Resize(object sender, System.EventArgs e)
{
   Control control = (Control)sender;


   double percentage = 0.7;    
   int width = control.Size.Width;
   //width = (int)Math.Round(test*perc); imagewidth 70% of form width
   int heigth = control.Size.Width;

   picturebox1.Size = new Size(width,height);  

}