underswamp
New member
- Joined
- Jan 5, 2014
- Messages
- 1
- Programming Experience
- Beginner
Hi all,
I'm a beginner who's come to a roadblock. My goal is to make code that will beep randomly anywhere from1 to 30 seconds apart. Here is my code so far:
This beeps every one second. Now, Iwant to change the Timer Interval so that it will beep randomlybetween 1 and 30 seconds. Maybe later I will add options for the userto define the bounds, but for now, 1 and 30 are good numbers. I justdon't know how to apply a random number to my Timer Interval. Cananyone help? Thanks in advance.
I'm a beginner who's come to a roadblock. My goal is to make code that will beep randomly anywhere from1 to 30 seconds apart. Here is my code so far:
VB.NET:
Public Class Form1
Private Sub Timer1_Tick(ByValsender As System.Object, ByVal e As System.EventArgs) HandlesTimer1.Tick
Console.Beep()
End Sub
Private Sub Button2_Click(ByValsender As System.Object, ByVal e As System.EventArgs) HandlesButton2.Click
Timer1.Stop()
End Sub
Private Sub Button1_Click(ByValsender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
Timer1.Start()
End Sub
End Class
This beeps every one second. Now, Iwant to change the Timer Interval so that it will beep randomlybetween 1 and 30 seconds. Maybe later I will add options for the userto define the bounds, but for now, 1 and 30 are good numbers. I justdon't know how to apply a random number to my Timer Interval. Cananyone help? Thanks in advance.