for (int i = 0; i < 16; i++)
{
path = @"D:\1.png ";
if (System.IO.File.Exists(path))
{
System.Drawing.Image Image = System.Drawing.Image.FromFile(path);
System.Drawing.Image bmp = new System.Drawing.Bitmap(Image);
object ob = this.GetType().GetField("pictureBox" + i.ToString(), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(this);
PictureBox pictureBox = (PictureBox)ob;
pictureBox.Image = bmp;
Image.Dispose();
}
}
C# 多个PictureBox控件循环
最新推荐文章于 2023-02-23 09:35:20 发布