imagelist和image控件之间的配合问题。
请问如何将某个目录里的图片文件加载到imagelist里?然后再用image控件依次显示出来?
谢谢了,苦恼好长时间了。
[解决办法]
在imagelist里面把你的图片一张张地手工添加进去,可以使image旋转起来。在一个Timer事件中执行。
[解决办法]
Dim i As Integer
Private Sub Command1_Click()
Dim strFile As String
i = 1
strFile = Dir("D:\Documents and Settings\Administrator\My Documents\My Pictures\*.gif")
Do Until strFile = ""
Image1.Picture = LoadPicture("D:\Documents and Settings\Administrator\My Documents\My Pictures\" & strFile)
ImageList1.ListImages.Add i, "t" & CStr(i), Image1.Picture
strFile = Dir()
i = i + 1
Loop
Timer1.Enabled = True
i = 1
End Sub
Private Sub Timer1_Timer()
If ImageList1.ListImages.Count >= i Then
Image1.Picture = ImageList1.ListImages(i).Picture
Me.Refresh
i = i + 1
If i > ImageList1.ListImages.Count Then i = 1
End If