Assign a resource to a Picture Box programatically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jürgen Heyn

    #1

    Assign a resource to a Picture Box programatically

    Good afternoon,

    I would like to display a bitmap in a PictureBox which is stored in a
    resource file.

    The following code works perfectly:
    picUser.Image = My.Resources.Re sUserIcon01.x48 _Crewmember

    From a database the application retrieves a string:
    "x48_Crewmember " (or "ResUserIcon01. x48_Crewmember" )

    How can I display the bitmap in a PictureBox using this string?

    I could do ist with the following:
    Select Case True
    Case strBildname = "x48_Crewmember "
    picUser.Image = My.Resources.Re sUserIcon01.x48 _Crewmember
    ....
    End Select

    Because of the number of bitmaps there must be a more elegant way.
    Thank you for any hint.
    Best regards
    Jürgen Heyn, Wilhelmshaven, Germany


Working...