user3053178
user3053178

Reputation: 3

Add image of Button to any Picture Box

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

Answers (1)

jasonnissen
jasonnissen

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

Related Questions