|
尝试使用imagelist,但图片始终加不进去。一到add就出问题。说是type mismatch。不知道问题在哪里。
Private Sub Command1_Click()
Dim imgFolder As Folder
Dim imgFile As File
Dim fso As FileSystemObject
Dim imgList As ImageList
Dim imgX As ListImage
Set imgList = Me.ImageList0.Object
Set fso = New FileSystemObject
Set imgFolder = fso.GetFolder(CurrentProject.Path & "\icon")
For Each imgFile In imgFolder.Files
Set imgX = imgList.ListImages.Add(, imgFile.Name, imgFile.Path)
Next imgFile
MsgBox imgList.ListImages.Count
End Sub |
|