How do you load an image from resource file in vb 2010 expresss?

前端 未结 2 373
鱼传尺愫
鱼传尺愫 2021-01-07 01:45

First of all Im new to vb 2010 and so far have enjoyed what I have been able to do with it. That being said I have run into an issue with my current project.

Basica

相关标签:
2条回答
  • 2021-01-07 02:30

    I have tried this form, and it is functional

    Picturebox1.Image = Image.FromHbitmap(My.Resources.imagename.GetHbitmap())

    0 讨论(0)
  • 2021-01-07 02:51

    i think you are looking for this:

    Dim currentMin as string = "_" & minutes.text ' it would look something like this: _1
    picturebox1.Image = CType(My.Resources.ResourceManager.GetObject(currentMin), Image)
    
    Dim currentSec as string = "_" & seconds.text
    picturebox2.Image = CType(My.Resources.ResourceManager.GetObject(currentSec), Image)
    
    0 讨论(0)
提交回复
热议问题