-
Hi.
Does anybody know how to find out when a picture is loaded? (without looking)
I have this:
With Start
.Visible = False
.Stretch = False
.Picture = LoadPicture(lp)
End With
But I need to know when the picture is finished loading, and... but this is not important.. somehow wait until the task is finished before doing something else. Any Ideas?
Thanks
-
A DoEvents might do the trick.
Code:
With Start
.Visible = False
.Stretch = False
.Picture = LoadPicture(lp)
DoEvents
Msgbox "Picture done"
End With
-
The picture property returns a handle when it's loaded with a stdpicture so you check for the handle
Code:
do until .picture
doevents
loop
-
Thanks. I tried the:
DoEvents
Msgbox "Picture done"
End With
before I posted anything here, and that worked fine... until it had to load two pictures.. like this:
frmPage.Picture1.Picture = LoadPicture("d:/cata/blue.bmp")frmPage.Picture2.Picture = LoadPicture("d:/cata/red.bmp")frmPage.Picture3.Picture = LoadPicture("d:/cata/green.bmp")
DoEvents
Msgbox "Picture done"
then for some reason it continued the execution of the rest of the code before all the pictures was loaded.
the
do until .picture
doevents
loop
works fine...
thanks