VB icon

a - Navigate And Wait a Web Browser Control

Email
Submitted on: 1/1/2015
By: Brogan Scott Houston McIntyre  
Level: Beginner
User Rating: By 5 Users
Compatibility: VB 5.0, VB 6.0
Views: 1
 
     Navigate a web browser control and wait for it to finish loading before going on to the next lines of code!
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: a - Navigate And Wait a Web Browser Control
' Description:Navigate a web browser control and wait for it to finish loading before going on to the next lines of code!
' By: Brogan Scott Houston McIntyre
'
' Assumes:You simply need to have a Web Browser control on your form and add this sample code.
'**************************************

'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


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.