Reputation:
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
Reputation: 113402
If the resource is a bitmap, this should work:
ptbLocalidadAdd.Image = Properties.Resources.addg;
Upvotes: 3