110,533
社区成员
发帖
与我相关
我的任务
分享
int min=0;
int max=0;
foreach (Control c in this.Controls)
{
if (c.GetType() == typeof(PictureBox))
{
if (MinVal > c.Location.X)
{
MinVal = c.Location.X;
continue;
}
if (MaxVal < c.Location.X)
{
MaxVal = c.Location.X;
continue;
}
}
}
MessageBox.Show(MinVal + " " + MaxVal);