DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   timer in VB? (http://www.daniweb.com/forums/thread132830.html)

mykar_88 Jul 5th, 2008 2:24 pm
timer in VB?
 
hi
how to make the process sleep until my webbrowser gets loaded.
this is my code


webbrowser1.navigate("www.google.co.in")
text=webbrowser1.document.body.innertext



pls send me the code

selvaganapathy Jul 5th, 2008 11:17 pm
Re: timer in VB?
 
Use BeforeNavigate Event and NavigateComplete Event.

Ex.
Draw a Command Button (Command1) and PictureBox (Picture1)
Draw WebBrowser Control (WebBrowser1) inside PictureBox

Private Sub Command1_Click()
  WebBrowser1.Navigate ("www.google.co.in")
End Sub

Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
  Picture1.Enabled = False
End Sub

Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
  Picture1.Enabled = True
End Sub

Instead of PictureBox u can use Frame Control


All times are GMT -4. The time now is 10:35 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC