展开全部
一个按钮,一个文本框用于输入文件夹地址(要正确输入,不要加引号),一个WMP,一个文件列表框
Dim i%
Private Sub Command1_Click()
On Error GoTo userCanceled
File1.Path = Text1.Text
If File1.ListCount < 2 Then Exit Sub
i = Int((File1.ListCount - 1) * Rnd)
File1.Selected(i) = True
WindowsMediaPlayer1.URL = File1.Path & "\" & File1.FileName
userCanceled:
End Sub
Private Sub Form_Load()
File1.Pattern = "*.AVI;*.MOV;*.DAT;*.MPG;*.WAV;*.MID;*.QT;*.MPEG;*.F4V" & _
";*.RM;*.RMVB;*.WMV;*.FLV;*.3GP;*.MP4;*.MP3;*.ASF;*.WMA;*.MKV;*.BC!"
End Sub
Private Sub WindowsMediaPlayer1_MediaChange(ByVal Item As Object)
WindowsMediaPlayer1.Controls.play
End Sub
Private Sub WindowsMediaPlayer1_PlayStateChange(ByVal NewState As Long)
Select Case NewState
Case Is = wmppsMediaEnded
WindowsMediaPlayer1.Controls.play
i = Int((File1.ListCount - 1) * Rnd)
File1.Selected(i) = True
WindowsMediaPlayer1.URL = File1.Path & "\" & File1.FileName
End Select
End Sub
Dim i%
Private Sub Command1_Click()
On Error GoTo userCanceled
File1.Path = Text1.Text
If File1.ListCount < 2 Then Exit Sub
i = Int((File1.ListCount - 1) * Rnd)
File1.Selected(i) = True
WindowsMediaPlayer1.URL = File1.Path & "\" & File1.FileName
userCanceled:
End Sub
Private Sub Form_Load()
File1.Pattern = "*.AVI;*.MOV;*.DAT;*.MPG;*.WAV;*.MID;*.QT;*.MPEG;*.F4V" & _
";*.RM;*.RMVB;*.WMV;*.FLV;*.3GP;*.MP4;*.MP3;*.ASF;*.WMA;*.MKV;*.BC!"
End Sub
Private Sub WindowsMediaPlayer1_MediaChange(ByVal Item As Object)
WindowsMediaPlayer1.Controls.play
End Sub
Private Sub WindowsMediaPlayer1_PlayStateChange(ByVal NewState As Long)
Select Case NewState
Case Is = wmppsMediaEnded
WindowsMediaPlayer1.Controls.play
i = Int((File1.ListCount - 1) * Rnd)
File1.Selected(i) = True
WindowsMediaPlayer1.URL = File1.Path & "\" & File1.FileName
End Select
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
logo在线生成器
2024-10-23 广告
2024-10-23 广告
燕雀零一专业logo生成器,是一家科技型的设计公司,团队深耕企业品牌设计服务已有十余年,已助力多家企业塑造其品牌形象及体验,服务内容含:LOGO设计/VI设计/产品包装设计/导视店面门头及空间设计,吉祥物设计/海报设计等。 我们的目标是帮助...
点击进入详情页
本回答由logo在线生成器提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询