1个回答
推荐于2016-02-08 · 知道合伙人互联网行家
关注
展开全部
加入一个定时器控件,interval属性改为1000,
加入一个命令按键控件,caption属性改为“开始计时”,
加入一个复选框控件,cpation属性改“开始计时后自动隐藏程序”,
其它属性一律不要动!
然后打开代码窗口,把里面的内容清空,把下面一段代码粘贴进去:
Dim dingshi As String
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub PlayWavFile(strFileName As String, PlayCount As Long, JianGe As Long)
'strFileName 要播放的文件名(带路径)
'playCount 播放的次数
'JianGe 多次播放时,每次的时间间隔
If Len(Dir(strFileName)) = 0 Then Exit Sub
If PlayCount = 0 Then Exit Sub
If JianGe < 1000 Then JianGe = 1000
DoEvents
sndPlaySound strFileName, 16 + 1
Sleep JianGe
Call PlayWavFile(strFileName, PlayCount - 1, JianGe)
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
If Check1.Value = 1 Then
Form1.Hide
App.TaskVisible = False
End If
End Sub
Private Sub Form_Load()
Show
Timer1.Enabled = False
dingshi = InputBox("时间格式为00:00:00,请输入正确,否则出错", "输入")
End Sub
Private Sub Timer1_Timer()
If dingshi = Time$ Then
PlayWavFile "C:\Documents and Settings\Administrator\桌面\配音\火星片花-广告回来继续关注.wav", 1, 1000
End If
End Sub
输入时间格式时那个冒号要是英文的冒号,中文的会出错,
最后这句PlayWavFile "C:\Documents and Settings\Administrator\桌面\配音\火星片花-广告回来继续关注.wav", 1, 1000
路径改成你的声音路径,格式必须是.wav格式的,不然播放不出来,后面那个1是重复次数,那个1000是重复时的间隔,还不懂就追问我,忙活了这么长时间,怎么也得给个辛苦分吧?
加入一个命令按键控件,caption属性改为“开始计时”,
加入一个复选框控件,cpation属性改“开始计时后自动隐藏程序”,
其它属性一律不要动!
然后打开代码窗口,把里面的内容清空,把下面一段代码粘贴进去:
Dim dingshi As String
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub PlayWavFile(strFileName As String, PlayCount As Long, JianGe As Long)
'strFileName 要播放的文件名(带路径)
'playCount 播放的次数
'JianGe 多次播放时,每次的时间间隔
If Len(Dir(strFileName)) = 0 Then Exit Sub
If PlayCount = 0 Then Exit Sub
If JianGe < 1000 Then JianGe = 1000
DoEvents
sndPlaySound strFileName, 16 + 1
Sleep JianGe
Call PlayWavFile(strFileName, PlayCount - 1, JianGe)
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
If Check1.Value = 1 Then
Form1.Hide
App.TaskVisible = False
End If
End Sub
Private Sub Form_Load()
Show
Timer1.Enabled = False
dingshi = InputBox("时间格式为00:00:00,请输入正确,否则出错", "输入")
End Sub
Private Sub Timer1_Timer()
If dingshi = Time$ Then
PlayWavFile "C:\Documents and Settings\Administrator\桌面\配音\火星片花-广告回来继续关注.wav", 1, 1000
End If
End Sub
输入时间格式时那个冒号要是英文的冒号,中文的会出错,
最后这句PlayWavFile "C:\Documents and Settings\Administrator\桌面\配音\火星片花-广告回来继续关注.wav", 1, 1000
路径改成你的声音路径,格式必须是.wav格式的,不然播放不出来,后面那个1是重复次数,那个1000是重复时的间隔,还不懂就追问我,忙活了这么长时间,怎么也得给个辛苦分吧?
追问
不用声音呢 ?就是普通的JPG的图片呢?就不用后面的了吧
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询