Hi there, I'm pretty new to c# (started up a few days ago) and I'm making a simple program, so far everything is going good except I can't figure somethine out.. hence why I'm here.
Anyways, in my program I have a picture box that when the user clicks it I want it to change the picture, and when the user clicks it again I want it to change back to the first image. So I figured a simple if statement would work, well it doesn't. Again I'm a complete c# noob and I might be missing something, or going about it the wrong way. here is the code I have so far
if (pictureBox.Image == global::WindowsApplication.Properties.Resources.im age1)
{
pictureBox.Image = global::WindowsApplication.Properties.Resources.im age2;
}
else
{
pictureBox.Image = global::WindowsApplication.Properties.Resources.im age1;
}
I've googled this a lot and I can't seem to find an answer or an example of anyone doing something like this with a picturebox, so I figured I would ask here. Thanks in advance.