I'm developing an application and I'm trying to keep it as object oriented as possible. The application needs to collect information from web pages here and there and/or fill out forms on a website.
The problem I run into is this: Traditionally.. most people will tell you that the best way to wait for a website to finish loading is this:
Loop Until WB.IsBusy = False
This is all well and good and works, but firing doevents that many times causes a high cpu usage, and this does not seem practical. Another alternative I have heard mentioned is to call System.Threading.Thread.Sl
eep(10). This does lower the CPU usage, but it brings the entire thread to a complete stop, which is also not a practical solution.
'Wait to recieve document complete event back from browser class
Do more stuff.
This SHOULD be able to happen, right? It would be ridiculous to set up variables to keep track of what's currently happening and what to do next instead of just waiting until the browser is done loading with an event. I'm just not sure how to make the particular function I'm in not process the next line of code until it recieves the event from my browser class without looping and using Application.Doevents. Or maybe there's a better way to implement this?