jack niekerk
asked on
VB6 DoEvents use
On form with a lot off frames wich need to be visible or not on certain moments
I do e.g. this
fraControle.Visible = True
fraControle.ZOrder vbBringToFront
AviFile$ = "CLOSEBOOKS.AVI"
With anicreer
.Open AviFile$
.Play
End With
DoEvents
where Avi files is located on the fracontrole
Now, if i use DoEvents , the frame will show perfect
But, the program (its big!) goes for some minutes around all kind off subs
before continue
If I don not use DoEvents , it starts right away but the frame is not showing
is there some way to do this better or other way
AviPlay AviFile$
DoEvents
I do e.g. this
fraControle.Visible = True
fraControle.ZOrder vbBringToFront
AviFile$ = "CLOSEBOOKS.AVI"
With anicreer
.Open AviFile$
.Play
End With
DoEvents
where Avi files is located on the fracontrole
Now, if i use DoEvents , the frame will show perfect
But, the program (its big!) goes for some minutes around all kind off subs
before continue
If I don not use DoEvents , it starts right away but the frame is not showing
is there some way to do this better or other way
AviPlay AviFile$
DoEvents
Try showing your form first before opening the AVI file.
What happens if you move:
DoEvents
below the line:
fraControle.ZOrder vbBringToFront
DoEvents
below the line:
fraControle.ZOrder vbBringToFront
ASKER
Try showing your form first before opening the AVI file.
in my listing, thats what I allready do\
in my listing, thats what I allready do\
ASKER
moving line not either, it looks like that somehow there is a need to proces this fact showing a frame while programs continues with tasks, it need or some pause to do it or force this using doevenst, problem is still that using dovents keeps running to long , wander if there would be a way to do this for some seconds and then quit the "doevenst'
ASKER
this solved the problem
instead off:
AviPlay AviFile$
DoEvents
put the doevents in a loop
like this:
AviPlay AviFile$
Dim iStop As Single
iStop = Timer + 1
Do
DoEvents
Loop While Not Timer >= iStop
then program continues
instead off:
AviPlay AviFile$
DoEvents
put the doevents in a loop
like this:
AviPlay AviFile$
Dim iStop As Single
iStop = Timer + 1
Do
DoEvents
Loop While Not Timer >= iStop
then program continues
What happens if you have:
fraControle.ZOrder vbBringToFront
DoEvents
Sleep 100
fraControle.ZOrder vbBringToFront
DoEvents
Sleep 100
ASKER
sleep 100 will give in VB6 a sub or function not defined error
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.