Important alert: (current site time 12/20/2014 9:53:13 PM EDT)
 

VB icon

a - Navigate And Wait a Web Browser Control

Email
Submitted on: 2/25/2013 3:38:26 PM
By: Brogan Scott Houston McIntyre 
Level: Beginner
User Rating: By 6 Users
Compatibility: VB 5.0, VB 6.0
Views: 12834
 
     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!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' 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 code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=45358&lngWId=1'for details.'**************************************

'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 8 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

12/16/2004 5:45:36 PM

Thanks for this code it is very useful!
(If this comment was disrespectful, please report it.)

 
3/26/2005 4:01:04 PM

Great code very simple just what i was looking for. so simple i didnt think of it my self =P
thanks
(If this comment was disrespectful, please report it.)

 
7/7/2006 10:38:27 AM

I could be ban from a game for that code :p
It continue when get the entire code but not even load the web...

Its useful if u wanna parse something quick but safe :P
(If this comment was disrespectful, please report it.)

 
10/14/2011 5:48:24 AMali muntaha

i want to having your code. please send me. thanks ...
(If this comment was disrespectful, please report it.)

 

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.