delete
delete

Reputation:

Setting a picture from my Resources programmatically to a PictureBox

How can I set a picture to a PictureBox in code?

The code below gives me the error:

Cannot implicitly convert Bitmap to String.

    private void ptbLocalidadAdd_MouseEnter(object sender, EventArgs e)
    {
        ptbLocalidadAdd.ImageLocation = Properties.Resources.addg;
    }

Upvotes: 2

Views: 7808

Answers (1)

Ani
Ani

Reputation: 113402

If the resource is a bitmap, this should work:

ptbLocalidadAdd.Image = Properties.Resources.addg;

Upvotes: 3

Related Questions