Change PictureBox's image to image from my resources?

后端 未结 6 2063
我寻月下人不归
我寻月下人不归 2020-12-08 14:38

How do I set a PictureBox image to an image from my resources?

(I tried this without success: pictuerbox.Image = \"img_location\";)

6条回答
  •  无人及你
    2020-12-08 14:47

    If you loaded the resource using the visual studio UI, then you should be able to do this:

    picturebox.Image = project.Properties.Resources.imgfromresource
    

提交回复
热议问题