Avatar of johnmoed
johnmoed
 asked on

Pause program until page loads?

I am trying to finish a program that compares two pages to see if they are different or same. The program works fine if I seperate the two functions. If I combine the functions, the result is always different because the page from the web doesn't load fast enough.

Is there a way to pause the program until both pages are loaded? The program checks webpages for changes against a local copy of the page stored on my hard drive.
Visual Basic.NET

Avatar of undefined
Last Comment
johnmoed

8/22/2022 - Mon
Bob Learned

Where are you doing this from?  Is this an ASP.NET or WinForms application?

Bob
johnmoed

ASKER
This is a WinForms application. It connects to an SQL server that stores the filename and URL location. I have 2 textboxes, one that has the text from the saved file (I will probably stop saving the file and store the text in SQL) and the other contains the text from the URL. When the two pages are loaded, I have a function that compares the two textboxes, but, for some reason, the function runs before the URL text is loaded.

I was wondering if there is something that I can do to pause the program until the URL text is completely loaded.

Thanks,
John
Bob Learned

How are you loading the URL?

Bob
Your help has saved me hundreds of hours of internet surfing.
fblack61
iboutchkine

Can you hide the form and show it when the page is loaded?
johnmoed

ASKER
I load the page using:
AxWebBrowser1.Navigate(txtURL.Text)
johnmoed

ASKER
I guess I could hide the form until the page is loaded, but I don't know how to do that... I am pretty much a beginner!

Would that make a difference though? It seems like the function is starting multiple threads for each command that I give and none waits until the other is finished. They all pop up out of my order.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Bob Learned

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
iboutchkine

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
johnmoed

ASKER
I got this working with by moving the Check function to the AxWebbrowser1.DocumentComplete Function. I may need some additional tinkering.
I think that I will post another question with some more points for my other problem.

Thanks,
John