2
Answers

How to change an image in a label during runtime

syncan

syncan

13y
4.9k
1
I try to make a simple program where I have an image in a label.
The name of the label is just label1.
The name of the old image is dob1.png and is initially placed in label1.image property using the Form.cs designer.

Now I want to replace dob1.png by the new dob2.png at runtime when you click on a button.

I know that I must put the code in the button-click event, but I dont know what the code should be.
What I think is that it should start with something like

this.label1.image .......

but what comes next? I cannot find it in the help of Visual-C# Express.

Can somebody help me out?


Answers (2)