ImageList help in VB .NET - Display the Filename

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MattGaff
    New Member
    • Oct 2007
    • 24

    ImageList help in VB .NET - Display the Filename

    I have made an imagelist and populated it with a few images where the filename of each of the files is important.

    I can generate the random images in a PictureBox when I click a button. The code is:
    Me.bxPics.Image = ImgLst.Images.I tem(i)

    where i is a randomly generated number. Underneath the picture box is a text box where I would like the filename of the picture to be displayed. I don't understand how this is so hard to implement as in the imagelist properties, I can see the index of each picture as well as the FileName (or Name as it is displayed)

    Is this possible?
  • dspenca
    New Member
    • Dec 2007
    • 1

    #2
    Yep...

    Had the same problem thsi morning simple answer just not very obvious.....

    Me.LblPics.Text = ImgLst.Images.K eys.Item(i).ToS tring

    you may not need the toString

    Rgds!..

    Comment

    • MattGaff
      New Member
      • Oct 2007
      • 24

      #3
      Cheers dude you are a legend.

      Works a treat.

      Comment

      Working...