VB中如何在单击command按钮时播放一小段声音,类似于按键音的。
2个回答
展开全部
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Const SND_FILENAME = &H20000
Private Sub Command1_Click()
PlaySound "e:\tmp\2.wav", 0&, SND_ASYNC + SND_FILENAME
MsgBox "听到声音了吗?"
End Sub
Private Const SND_ASYNC = &H1
Private Const SND_FILENAME = &H20000
Private Sub Command1_Click()
PlaySound "e:\tmp\2.wav", 0&, SND_ASYNC + SND_FILENAME
MsgBox "听到声音了吗?"
End Sub
更多追问追答
追问
声音是有了可是不受按键控制,只要进入那个页面不单击按钮声音也会出来
追答
你的播放命令是放在哪里的?能把代码放出来看看吗?
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询