Public Declare Function PlaySound Lib "winmm.dll" (ByVal lpszSoundName As String,ByVal hModule As Integer,ByVal dwFlags As Integer) As Integer
Const SND_FILENAME As Integer = &H20000 ' 文件模式
Const SND_ALIAS As Integer = &H10000 '自己查查
Const SND_SYNC As Integer = &H0 '同步
Const SND_ASYNC As Integer = &H1 '异步
Const SND_LOOP As Integer = &H8 '循环
‘播放音乐
Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.Click Dim nologin As String = "LoopyMusic.wav" PlaySound(nologin,SND_LOOP Or SND_ASYNC) End Sub ‘停止播放音乐 Private Sub Button2_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button2.Click PlaySound(vbNullString,0) End Sub