If you have multiple timers you could add them to a list, then use a random number from zero to the list count to select which timer to start, try something like...
Code:Private myTimers As New List(Of Timer) Private rand As New Random Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load ' add timers to the list myTimers.AddRange({Timer1, Timer2, Timer3}) End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click ' get random number between zero and our timers list count Dim index As Integer = rand.Next(0, myTimers.Count) ' start the timer myTimers(index).Start() End Sub




Reply With Quote