1 Replies - 11845 Views - Last Post: 19 February 2009 - 08:08 AM Rate Topic: -----

#1 developerman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 28-March 08

adding image to imagelist via code!

Posted 19 February 2009 - 07:23 AM

 imagelist1.image.add("DSCF00082.jpg")


I tried using the above code to add an image to an IMAGELIST but it is to no success.

I want to know if there is a way to add an image to an image list via code as opposed to using the collection.

From what I understand... The above code that I used should work but I don't know why it doesn't
Is This A Good Question/Topic? 0
  • +

Replies To: adding image to imagelist via code!

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1633
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: adding image to imagelist via code!

Posted 19 February 2009 - 08:08 AM

You're trying to add a string representation of an image to an ImageList, whereas the ImageList needs an actual image. Try this route

Dim img As System.Drawing.Image.FromFile("DSCF00082.jpg")
imageList1.Images.Add(img)



Hope that helps figure this out for you :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1