VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



a Navigate And Wait a Web Browser Control

by Brogan Scott Houston McIntyre (2 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

Navigate a web browser control and wait for it to finish loading before going on to the next lines of code!

Assumes
You simply need to have a Web Browser control on your form and add this sample code.

Rate a Navigate And Wait a Web Browser Control

'This is the NavigateAndWait sub.
'rURL is the hyperlink that you want the web browser control to navigate to.
'rWebBrowser is the web browser control that you would like to use.
Public Sub NavigateAndWait(rURL As String, rWebBrowser As Control)
rWebBrowser.Navigate rURL 'Navigate to any URL.
Do Until rWebBrowser.ReadyState = READYSTATE_COMPLETE 'Loop until the web browser control is ready.
  DoEvents 'This will stop the program from locking up while waiting, and allow other code to continue processing.
Loop
End Sub
Private Sub Command1_Click() 'This is an example button.
NavigateAndWait "http://www.Planet-Source-Code.com", Me.WebBrowser1 'This is an example on how to call the NavigateAndWait sub.
MsgBox "Loaded!" 'This is a message box to alert you that the page has been loaded. This line is not required.
End Sub

Download this snippet    Add to My Saved Code

a Navigate And Wait a Web Browser Control Comments

No comments have been posted about a Navigate And Wait a Web Browser Control. Why not be the first to post a comment about a Navigate And Wait a Web Browser Control.

Post your comment

Subject:
Message:
0/1000 characters