【发布时间】:2014-08-02 10:40:41
【问题描述】:
PictureBox1.Image = "WindowsApplication4.My.Resources.Resources._" & itemno.Text
您好,我有一堆图片,编号为 (1-100),当用户在“itemno”输入框中输入数字时,picturebox1.image 会相应更改。我如何实现上面代码示例中的内容?
【问题讨论】:
标签: vb.net string typeconverter
PictureBox1.Image = "WindowsApplication4.My.Resources.Resources._" & itemno.Text
您好,我有一堆图片,编号为 (1-100),当用户在“itemno”输入框中输入数字时,picturebox1.image 会相应更改。我如何实现上面代码示例中的内容?
【问题讨论】:
标签: vb.net string typeconverter
您可以使用ResourceManager 按名称获取资源。
PictureBox1.Image = DirectCast(My.Resources.ResourceManager.GetObject("name_of_image"), Bitmap)
【讨论】: