I have a form in C # that has a button that, when clicked, I want the background image to cycle through a set of images (which I have as resources for the project). The images are called "_1", "_2", etc., And every time I press a button, I want its background image to increase to the next and return to "_1" when it reaches the highest. Is there any way to do this?
I tried to get it button1.BackgroundImage.ToString(), but it gives System.Drawing.Bitmapinstead Resources._1what I thought it would be (in this case, I could just get the last character and turn it on to change the background to the corresponding new image).
Thank you for your help.
source
share