views:

42

answers:

1

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

This code gives me the error:

Cannot implicitly convert Bitmap to String.

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

If the resource is a bitmap, this should work:

ptbLocalidadAdd.Image = Properties.Resources.addg;
Ani