CodeItBetter Programming Another VB Programming Blog

How to add images to imagelist control at runtime

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
'Controls - How to add images to imagelist control at runtime
'Adding images at run time requires you to use the Add method of the 
'ListImages collection, the syntax of which is the following:

Add([index], [Key], [Picture]) As ListImage
 
'If you omit the Index argument, you add the new image at the end of the 
'collection. The following code creates a new ListImage item and associates it 
'with a bitmap loaded from disk:

Dim li As ListImage
Set li = ImageList1.ListImages.Add(, "Cut", LoadPicture("d:\bitmaps\cut.bmp"))
Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.