用等待标志等待下载结束。 private m_Waiting as booleanprivate sub cmdDownload_Click() dim i as long for i=0 to List1.ListCount-1 m_Wating = true Inet1.Execute ... while m_Wating DoEvents wend next end subprivate sub Inet1_StateChanged(ByVal State As Integer) if State=icResponseCompleted then ... m_Wating = False end if end sub
private m_Waiting as booleanprivate sub cmdDownload_Click()
dim i as long
for i=0 to List1.ListCount-1
m_Wating = true
Inet1.Execute ...
while m_Wating
DoEvents
wend
next
end subprivate sub Inet1_StateChanged(ByVal State As Integer)
if State=icResponseCompleted then
...
m_Wating = False
end if
end sub