how to check picturebox image?

Hi All,

I need your help. I have got a problem with the if statements. I want to check the picturebox through the resources as if the picturebox is reading the image called Image1, then display the messagebox.


1
2
3
4
5
6
7
8
9
10
private: System::Void button1_Click_1(System::Object^  sender, System::EventArgs^  e) {

			 ResourceManager^ resourceManager = gcnew ResourceManager("MyApplication1.myImages", GetType()->Assembly);
			 Bitmap^ image = (Bitmap^)resourceManager->GetObject ("Image1");

			 if (PictureBox1->Image->Equals(image))
			 {
				 MessageBox::Show("image is correct");	 
			 }
		 }



When I clicked on the button while the picturebox is reading the image, the messagebox doesn't display. Nothing have happened when I clicked on the button.

Any idea?
Topic archived. No new replies allowed.