Jimbo
Jimbo

Reputation: 1

C++ Change image based on a click (Visual Studio C++)

In visual studio, when making a C++ windows application form. I want a picture to change when I click on it.

So when I double click the picture and it brings up the click action script, what script do I use.....

Similiar to

 int temp = System::Int32::Parse(label1->Text);
 temp++; label1->Text =
 temp.ToString();

Which just increments an integer in a label

Upvotes: 0

Views: 4332

Answers (1)

Icenold
Icenold

Reputation: 11

PicutreBox1.OnClick += PictureBox1_Click(PictureBox1,System.Events.OnClick)
---------------------------------------------------------------------------
private void PictureBox1_Click(object^ sender, Events^ e)
{
  PictureBox1->Image=Image.FromFile(@"YourFolderPath/image.jpg")
}

Upvotes: 1

Related Questions