|
-
Jun 21st, 2000, 04:04 AM
#1
Thread Starter
Lively Member
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
-
Jun 21st, 2000, 04:37 AM
#2
Hyperactive Member
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)
-
Jun 21st, 2000, 04:43 AM
#3
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
-
Jun 21st, 2000, 04:55 AM
#4
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|