类型'String'的值不能转换为'System.Drawing.Image'

bo7ons
PictureBox1.Image = "WindowsApplication4.My.Resources.Resources._" & itemno.Text

嗨,我有一堆图片,所有图片的编号都为(1-100),并且当用户在“ itemno”输入框中输入数字时,picturebox1.image会相应更改。我如何实现上面的代码示例中的内容?

比昂·罗格·克林佐(Bjørn-RogerKringsjå)

您可以使用ResourceManager按名称获取资源。

PictureBox1.Image = DirectCast(My.Resources.ResourceManager.GetObject("name_of_image"), Bitmap)

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

将类型转换为System.Drawing.Image

来自分类Dev

'String' 类型的值不能转换为 'String()'

来自分类Dev

Error1类型'String'的值不能转换为'System.Windows.Forms.Control'

来自分类Dev

从image转换为base64,System.drawing.image

来自分类Dev

类型'List(of Strings)的值不能转换为String()

来自分类Dev

无法将“System.String”类型的值转换为“System.Type”类型

来自分类Dev

将“ System.String []”转换为类型“ System.String”

来自分类Dev

无法处理参数“机器”上的参数转换。无法将值转换为 System.String 类型

来自分类Dev

将System.Drawing.Icon转换为System.Windows.Controls.Image

来自分类Dev

来自数据源的String类型的给定值不能转换为指定目标列的int类型

来自分类Dev

将类型'System.Drawing.Bitmap'转换为'Emgu.CV.IImage'

来自分类Dev

无法将类型字符串隐式转换为System.Drawing.Color

来自分类Dev

类型'System.Data.SqlClient.SqlConnection'的错误值无法转换为'String'

来自分类Dev

将字节数组转换为System.Drawing.Image时出错

来自分类Dev

将字节数组转换为System.Drawing.Image时出错

来自分类Dev

[InvalidCastException:无法将类型为“ System.DBNull”的对象转换为类型为“ System.String”。]

来自分类Dev

无法将类型为“ System.Byte []”的对象转换为类型为“ System.String”的对象

来自分类Dev

无法将“System.DateTime”类型的对象转换为“System.String”类型。C#

来自分类Dev

'无法将类型为'System.String'的对象转换为类型'System.Windows.Controls.ComboBoxItem

来自分类Dev

JSONException:类型java.lang.String的值<br不能转换为JSONObject

来自分类Dev

错误。org.json.JSONException:类型java.lang.String的值<br不能转换为JSONObject

来自分类Dev

不兼容的类型:String[] 不能转换为 String

来自分类Dev

将值“ {” 1“:” 1“,” 3“:” 1“}”转换为类型'System.Collections.Generic.Dictionary`2 [System.String,System.String]'时出错

来自分类Dev

将System :: Drawing :: Bitmap ^转换为:: MAT

来自分类Dev

System.InvalidCastException:无法将类型为“ System.Int32”的对象转换为类型为“ System.String”的对象

来自分类Dev

{System.InvalidOperationException:将参数从“ System.String”类型转换为“ System.Collections.Generic.KeyValuePair”类型

来自分类Dev

无法将“WhereSelectArrayIterator`2[System.String,System.Byte]”类型的对象转换为“System.Byte[]”类型。网络

来自分类Dev

W/System.err: org.json.JSONException: 类型 java.lang.String 的值可能无法转换为 JSONArray

来自分类Dev

无法将类型为“ AttachmentDetailsDto”的对象转换为类型为“ System.String”的对象

Related 相关文章

  1. 1

    将类型转换为System.Drawing.Image

  2. 2

    'String' 类型的值不能转换为 'String()'

  3. 3

    Error1类型'String'的值不能转换为'System.Windows.Forms.Control'

  4. 4

    从image转换为base64,System.drawing.image

  5. 5

    类型'List(of Strings)的值不能转换为String()

  6. 6

    无法将“System.String”类型的值转换为“System.Type”类型

  7. 7

    将“ System.String []”转换为类型“ System.String”

  8. 8

    无法处理参数“机器”上的参数转换。无法将值转换为 System.String 类型

  9. 9

    将System.Drawing.Icon转换为System.Windows.Controls.Image

  10. 10

    来自数据源的String类型的给定值不能转换为指定目标列的int类型

  11. 11

    将类型'System.Drawing.Bitmap'转换为'Emgu.CV.IImage'

  12. 12

    无法将类型字符串隐式转换为System.Drawing.Color

  13. 13

    类型'System.Data.SqlClient.SqlConnection'的错误值无法转换为'String'

  14. 14

    将字节数组转换为System.Drawing.Image时出错

  15. 15

    将字节数组转换为System.Drawing.Image时出错

  16. 16

    [InvalidCastException:无法将类型为“ System.DBNull”的对象转换为类型为“ System.String”。]

  17. 17

    无法将类型为“ System.Byte []”的对象转换为类型为“ System.String”的对象

  18. 18

    无法将“System.DateTime”类型的对象转换为“System.String”类型。C#

  19. 19

    '无法将类型为'System.String'的对象转换为类型'System.Windows.Controls.ComboBoxItem

  20. 20

    JSONException:类型java.lang.String的值<br不能转换为JSONObject

  21. 21

    错误。org.json.JSONException:类型java.lang.String的值<br不能转换为JSONObject

  22. 22

    不兼容的类型:String[] 不能转换为 String

  23. 23

    将值“ {” 1“:” 1“,” 3“:” 1“}”转换为类型'System.Collections.Generic.Dictionary`2 [System.String,System.String]'时出错

  24. 24

    将System :: Drawing :: Bitmap ^转换为:: MAT

  25. 25

    System.InvalidCastException:无法将类型为“ System.Int32”的对象转换为类型为“ System.String”的对象

  26. 26

    {System.InvalidOperationException:将参数从“ System.String”类型转换为“ System.Collections.Generic.KeyValuePair”类型

  27. 27

    无法将“WhereSelectArrayIterator`2[System.String,System.Byte]”类型的对象转换为“System.Byte[]”类型。网络

  28. 28

    W/System.err: org.json.JSONException: 类型 java.lang.String 的值可能无法转换为 JSONArray

  29. 29

    无法将类型为“ AttachmentDetailsDto”的对象转换为类型为“ System.String”的对象

热门标签

归档