PictureBox1.Image = "WindowsApplication4.My.Resources.Resources._" & itemno.Text
嗨,我有一堆图片,所有图片的编号都为(1-100),并且当用户在“ itemno”输入框中输入数字时,picturebox1.image会相应更改。我如何实现上面的代码示例中的内容?
您可以使用ResourceManager按名称获取资源。
PictureBox1.Image = DirectCast(My.Resources.ResourceManager.GetObject("name_of_image"), Bitmap)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句