我想在加载表格时自动播放背景音乐。有人能帮我吗?我的代码是:
My.Computer.Audio.Play(My.Resources.christs, AudioPlayMode.BackgroundLoop)
最佳答案
这是针对Load 事件上的Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
My.Computer.Audio.Play(My.Resources.christs, AudioPlayMode.BackgroundLoop)
End Sub
如果表单是封闭,则音频会停止 Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
My.Computer.Audio.Stop(My.Resources.christs, AudioPlayMode.BackgroundLoop)
End Sub
关于vb.net - VB.Net何时自动播放BG音乐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20256774/