开发者

Setting a picture from my Resources programmatically to a PictureBox

开发者 https://www.devze.com 2023-01-18 06:22 出处:网络
How can I set a picture to a PictureBox in code? The code below gives me the error: Cannot implicitly convert Bitmap to

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;
    }


If the resource is a bitmap, this should work:

ptbLocalidadAdd.Image = Properties.Resources.addg;
0

精彩评论

暂无评论...
验证码 换一张
取 消