Link to home
Create AccountLog in
Avatar of jack niekerk
jack niekerkFlag for Netherlands

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
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Try showing your form first before opening the AVI file.
What happens if you move:
DoEvents
below the line:
fraControle.ZOrder vbBringToFront
Avatar of jack niekerk

ASKER

Try showing your form first before opening the AVI file.

in my listing, thats what I allready do\
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'
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
What happens if you have:
fraControle.ZOrder vbBringToFront  
DoEvents
Sleep 100
sleep 100 will give in VB6  a sub or function not defined error
ASKER CERTIFIED SOLUTION
Avatar of eemit
eemit
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer