JavascriptProva

martedì 8 gennaio 2019

Un problema di thread che non era di thread: files sonori di sottofondo

Creo il codice del thread:
    Sub MioThread()
        My.Computer.Audio.Play("C:\suoni\accord.wav",
        AudioPlayMode.BackgroundLoop)
    End Sub
e gli faccio eseguire il codice del suonare la musica di sottofondo.



Alla fine ho risolto il problema. I thread non c'entrano nulla, in questo caso:
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        My.Computer.Audio.Play("C:\suoni\accord.wav",
        AudioPlayMode.BackgroundLoop)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        If DirectCast(sender, Button).Text <> "PUGNO" Then
            DirectCast(sender, Button).Text = "PUGNO"
        Else
            DirectCast(sender, Button).Text = "SCORREGGIA"
        End If
    End Sub


End Class

Nessun commento:

Posta un commento