为何无法清除ImageList控件ListImages集合的图象?
maxim 2004-04-15 07:48:58 我使用了一个ImageList和一个ListView,将ImageList动态添加图片后,ListView通过以下代码调用:
For i = 1 To ImageList1.ListImages.Count
Set ic = ListView1.ListItems.add(, , "", i, i)
ic.SubItems(1) = ImageList1.ListImages(i).Key
Next i
当我要再次更新图片时,却无法清除ImageList控件ListImages集合的图象.以下这两种方法都行不通,不知道是什么原因?如何解决?
1
For i = ImageList1.ListImages.Count To 1 Step -1
ImageList1.ListImages.Remove i
Next
2
ImageList1.ListImages.Clear