我可以使用以下代码将图像添加到我的面板, 但现在我的问题是我需要从图像等中检索一些信息(键值)
是否可以为每个图像添加值?
foreach (System.Drawing.Image img in imagelist) {
PictureBox imagePicBox = new PictureBox();
imagePicBox.Name = "image" + imagePanel.Controls.Count.ToString();
imagePicBox.Image = img;
imagePicBox.Size = imagePicBox.Image.Size;
imagePicBox.BackColor = Color.Black;
imagePicBox.SizeMode = PictureBoxSizeMode.StretchImage;
imagePicBox.BorderStyle = BorderStyle.FixedSingle;
imagePanel.Controls.Add(imagePicBox);
}