I am tryig to change web pages randomly , the url 's are in text boxes. I
know how to change pages but I wanted to use one timer and change the
interval so it would move them at different times. Any ideas or sampe code
would be appreciated.
Thanks
Printable View
I am tryig to change web pages randomly , the url 's are in text boxes. I
know how to change pages but I wanted to use one timer and change the
interval so it would move them at different times. Any ideas or sampe code
would be appreciated.
Thanks
Can you use a radom number generator to keep changing the interval of the timer?
'gets a random number somwhere between 1 second and 10 seconds for the timer interval
Radomize
Timer1.Interval = Long((10000 * Rnd) + 1000)
use an incrementin counter type thingy, and a select case or an If statement.
Code:Dim CountThis As Integer ' put this in the gen. declarations
Private Sub Command1_Click()
Select Case CountThis
Case 0
txtUrl = "http://www.vb-world.net"
Case 1
txtUrl = "http://forums.vb-world.net"
Case 2
txtUrl = "http://www.vbapi.com"
Case 3
txtUrl = "http://msdn.microsoft.com"
'Case etc. etc.
End Select
CountThis = CountThis + 1
' only use 1 form of this code, the above is for the select case the bottom is for If...Else
If CountThis = 0 Then
txtUrl = "http://www.vb-world.net"
ElseIf CountThis = 1 Then
' etc.
End If
' I like the select case much better
End Sub
oh.. that will not really be random....
:(
but you can somehow limit the size of the nubers generated with a randon num. gen., and still use the select case...:)