要求有能打开歌曲文件夹的目录和显示歌曲的目录,有做好的直接M我,这是毕业设计,拜托各位高手了!~
怎么使用VB控件里的Windows media plays制作MP3播放器
- 提问者网友:轮囘Li巡影
- 2021-05-04 04:39
- 五星知识达人网友:山有枢
- 2021-05-04 05:09
代码:
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Dim o1, o2, o3, o4, o5
Private Sub Check1_Click()
If Check1.Value = 1 Then
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
Me.Hide
Else
Check2.Value = 0
End If
End Sub
Private Sub Command1_Click()
CommonDialog1.ShowOpen
Text1.Text = CommonDialog1.FileName
WindowsMediaPlayer1.URL = Text1.Text
End Sub
Private Sub Command2_Click()
File1.ListIndex = File1.ListIndex + 1
WindowsMediaPlayer1.URL = File1.FileName
End Sub
Private Sub Command5_Click()
'Text1.Text = Drive1.ListCount
ak = Drive1.ListIndex + 1
If ak = "1" Then
ak = "c:\"
ElseIf ak = "2" Then
ak = "d:\"
ElseIf ak = "3" Then
ak = "e:\"
ElseIf ak = "4" Then
ak = "f:\"
ElseIf ak = "5" Then
ak = "g:\"
End If
Dir1.Path = ak
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub File1_Click()
WindowsMediaPlayer1.URL = File1.Path + "\" + File1.FileName
End Sub
Private Sub Form_Load()
End Sub
Private Sub Timer1_Timer()
If WindowsMediaPlayer1.playState = wmppsPlaying Then
Else
File1.ListIndex = File1.ListIndex + 1
WindowsMediaPlayer1.URL = File1.Path + "\" + File1.FileName
End If
End Sub
Private Sub Timer2_Timer()
If GetKeyState(vbKeyF6) < 0 Then 'f6按下
Me.Show
Else
Check2.Value = 0
End If
End Sub
----------------------
要源码的联系我email:624475210@qq.com