Wait while webpage and source html load before going to next sub
Hello,
hmmmmmmmmmmmmmm...
I have a sub that calls a number of other subs one after the other. One of the subs it calls is to load a particular webpage into a webbrowser and use the downloadComplete (cheers dynamic_sysop ;) ) to load the source, obviously once the webpage has finished loading. After this there are a number of other subs to be called but the above two things have to be totally finished beforehand.
The problem is it goes straight through and doesn't wait for the webpage and source to be loaded (just calls the subs for these and carries on) :mad: . I can understand that this is what it should do, but I want it to hold off the exciting prospect of running the next sub until all webpage/source html loading has finished.
How to do this, well I thought if I put a boolean var in the downloadcomplete that becomes true when hit and the have a while not true loop in before the next sub it might work but it just loops infinitely and forgets the old webpage/source download that its s'posed to be doing. I tried putting a 'System.Threading.Thread.Sleep(1)' in the loop to see if that made it remember to do a bit of the downloading thing while looping but anyone with half a brain cell can see that I'm going kwayzeee and just trying nonsense ideas :rolleyes: .
Please could someone help me? I just want the program to wait until everything is downloaded before going to the next sub :(