vb对一个值判断 并发出声音 正确 错误 5
PrivateSubCommand9_Click(IndexAsInteger)IfRight(Text1.Text,1)="5"ThenText3.Text=Int(T...
Private Sub Command9_Click(Index As Integer)
If Right(Text1.Text, 1) = "5" Then
Text3.Text = Int(Text3.Text) + 10
Call PlaySound("C:\Users、")
Else:
Text3.Text = Int(Text3.Text) - 10
Call PlaySound("C:\Users、")
End If
End Sub
这段不对,看哪位大侠帮忙改一下 展开
If Right(Text1.Text, 1) = "5" Then
Text3.Text = Int(Text3.Text) + 10
Call PlaySound("C:\Users、")
Else:
Text3.Text = Int(Text3.Text) - 10
Call PlaySound("C:\Users、")
End If
End Sub
这段不对,看哪位大侠帮忙改一下 展开
3个回答
展开全部
PlaySound的完整函数是这样的:
Private Declare Fun拿掉ction sndPlaySound& Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long)
Private Declare Fun拿掉ction sndStopSound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszNull As Long, ByVal uFlags As Long) As Long
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP = &H8
Const SND_NOSTOP = &H10
Const SND_MEMORY = &H4
参数请不要少写
Call PlaySound("C:\Users、")可以改成
PlaySound "C:\Users、" , SND_SYNC
Private Declare Fun拿掉ction sndPlaySound& Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long)
Private Declare Fun拿掉ction sndStopSound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszNull As Long, ByVal uFlags As Long) As Long
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP = &H8
Const SND_NOSTOP = &H10
Const SND_MEMORY = &H4
参数请不要少写
Call PlaySound("C:\Users、")可以改成
PlaySound "C:\Users、" , SND_SYNC
展开全部
两句call的子程序补全后面的参数就好了,应该是两个音频文件的名称
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我只看到声音文件名都没有。"C:\Users\声音文件名"
更多追问追答
追问
文件名没打全,文件名是对的,就是没打全
错误提示是 必选参数
追答
能把工程发过来可以吗,szq261@sina.cn
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询