For a school project I need to make a timer with a bell sound that sounds every 60 seconds in VB, I cannot work out how to make the bell sound on the 60th second, I am not getting any errors in the VB console, so I assume that I am just using the wrong code or it is in the wrong place, if anyone can offer any advice or point me in the direction of resources, I would be forever in their debt.
Public Class OSCETimerControl
Dim t As Integer
Dim s As Integer
Dim a As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
t = 1
a = 60
End Sub
Private Sub BellTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BellTimer.Tick
NDBell.Text = (s)
s = s + 1
If NDBell Is "60" Then My.Computer.Audio.Play(My.Resources.bell, AudioPlayMode.Background)
End Sub
Private Sub Seconds_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Seconds.Tick
DSeconds.Text = (t)
t = t + 1
End Sub
^Thats what I have got so far I have however tried placing the code to run the wav file in the main form sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
t = 1
a = 60
If NDBell = (a) Then My.Computer.Audio.Play(My.Resources.bell, AudioPlayMode.Background)
End Sub
There are actually 3 text boxes (not yet coded the final one) one for minutes, one for seconds and the final one is for the bell sound which will not be visible.
Thanks in advance.