15 secondes après l'ouverture de l'application .
Dim timer As New Timer Private iCount As Integer = 0 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick iCount += 1 If iCount = 15 Then My.Computer.Audio.Play("c:\temp\ma_musique.wav", AudioPlayMode.Background) ElseIf iCount = 30 Then My.Computer.Audio.Stop() timer.Stop() End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load timer.Interval = 1000 timer.Start() End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim timer As New Timer Private iCount As Integer = 0 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load timer.Interval = 1000 timer.Start() My.Computer.Audio.Play("c:\temp\ma_musique.wav", AudioPlayMode.Background) End Sub Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) iCount += 1 If iCount = 15 Then My.Computer.Audio.Stop() End If End Sub
timer.Stop()en dessous de My.Computer.Audio.Stop()
Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Application.DoEvents()pour rentre la main au système d'exploitation