# 思路

www.MyException.Cn  网友分享于：2013-01-02  浏览：13次

picturebox1 picturebox2 picturebox3
-----------------picturebox4--------------
picturebox4的长度是与上面三个picturebox的长度对应的，上面有几个picturebox还不确定，

picturebox2 picturebox3
---------picturebox4-------

------解决方案--------------------

------解决方案--------------------
C# code
```if (picturebox1.Visible = true)        {          if (picturebox2.Visible = false)          {           }          else if (picturebox3.Visible = false)          {            picturebox4.Width = (this.Width - picturebox1.Location.x) - (this.Width - picturebox2.Location.X - picturebox1.Width);            picturebox4.Location = new Point(picturebox1.Location.X, picturebox1.Location.Y + picturebox1.Height);          }          else          {            picturebox4.Width = (this.Width - picturebox1.Location.x) - (this.Width - picturebox3.Location.X - picturebox1.Width );            picturebox4.Location = new Point(picturebox1.Location.X, picturebox1.Location.Y + picturebox1.Height);          }        }        else if (picturebox2.Visible = true)        {          if (picturebox2.Visible = false)          {          }          else if (picturebox3.Visible = false)          {            picturebox4.Width = (this.Width - picturebox2.Location.x) - (this.Width - picturebox2.Location.X - picturebox2.Width);            picturebox4.Location = new Point(picturebox2.Location.X, picturebox2.Location.Y + picturebox2.Height);          }          else          {            picturebox4.Width = (this.Width - picturebox2.Location.x) - (this.Width - picturebox3.Location.X - picturebox2.Width);            picturebox4.Location = new Point(picturebox2.Location.X, picturebox2.Location.Y + picturebox2.Height);          }        }        else if (picturebox3.Visible = true)        {          picturebox4.Width = (this.Width - picturebox3.Location.x) - (this.Width - picturebox3.Location.X - picturebox3.Width);          picturebox4.Location = new Point(picturebox3.Location.X, picturebox3.Location.Y + picturebox3.Height);        }        else        {          MessageBox.Show("3个图片都没有显示");        }
```