March 28th, 2013, 05:30 AM
-
Little help with picture box?
Code:
private: System::Void pictureBox1_Click(System::Object^ sender, System::EventArgs^ e) {
//change icon once picture is clicked.
// image 8 = tick
// 9 = cross
// 10 = qusetion
if (pictureBox1->Image->Equals(imageList1->Images[8]))
{
pictureBox1->Image = imageList1->Images[10];
} else if (pictureBox1->Image->Equals(imageList1->Images[10]))
{
pictureBox1->Image = imageList1->Images[9];
} else
{
pictureBox1->Image = imageList1->Images[8];
}
}
};
hey i want to check what image is in the box and then change to a different image depending on the image currently loaded..... any ideas??
March 28th, 2013, 09:07 AM
-
The image itself is just an array of bytes that would not be of any help to identify the image. When you first load the image, you should complete the tag property and use that for identifying the image.