我一直在试图检查PictureBox
是否具有特定图像。我使用Properties.Resources.TheImage
设置了PictureBox
的图像。根据使用ResX资源设置的图像查找图片框
使用下面的代码在PictureBox
控件中找不到图像。我一直在努力使这个工作:
foreach (Control X in Controls)
{
if (X is PictureBox)
{
if (((PictureBox)X).Image == Properties.Resources.TheImage)
{
MessageBox.Show("found the image");
}
}
}
问题是什么? – Sajeetharan