Reputation: 3
In my form load, there is a button and picture box. I added a image to my button(from backgroundimage) and When I click this button, the image is also added to Picture Box. How to do that?
Upvotes: 0
Views: 362
Reputation: 156
You should be able to set the Image property on the picturebox to the Button's Image property in the click event:
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.Image = button1.Image;
}
EDIT: Or the BackgroundImage property:
pictureBox1.Image = button1.BackgroundImage;
Upvotes: 1