Just playing about in VB and trying to make it so when you press a button it loads 1 pages then waits 1 second and then loads the next website within the WebBrowser Code: Private Sub TaterDrop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TaterDrop.Click WebBrowser1.Navigate("Website1") ' Wait 1 second then open next page WebBrowser1.Navigate("Website2") End Sub what ever I try to make it wait certain amount of time in between the 2 websites it just loads Website2 any help would be appreciated
that is basically it really just a simple web browser with 1 button Code: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub TaterDrop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TaterDrop.Click WebBrowser1.Navigate("Website1") 'Wait 1 second then open next page' WebBrowser1.Navigate("Website2") End Sub Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted End Sub End Class
basically when you press the button it will load website1 then once that has loaded i would like it to then load website2
Ok thanks I will have a read up I haven't touched VB since my college days 5 years ago everything is a blur aha
Add a timer and name it "TmrDelay" Then add this where you got wait 1 secound 1000 = 1 second Code: dim b as integer sub foo() tmrDelay.Interval = 1000 tmrdelay.enabled=true i=-1 tmrDelay.Start() while(i<0) wend end sub sub tmrDelay_tick() i=1 end sub
Good job too lazy to write that. it would have been better if he looked up how to do it himself so in the future he can do it by himself. but good job No prob it is easy to do these kinds of things. just takes a little practice/research. make sure to look for tutorials next time. they will explain everything in detail for you so can understand how to do it.
Thanks for the help. I feel stupid now asking that was easy to do really just me being dumb after 5 years of not even looking at VB ahaha
yeah I know lol, I put the comment there as I tend to get side tracked then forget what I was trying to do but its all sorted and working now