1. Buka VB 6.0 dengan project Standard.exe
2. Klik Ctrl+T. Ceklis "Microsoft Common Dialog Control 6.0" dan "Microsoft Multimedia Control 6.0"
3. Masukkan 1 buah label, 1 buah DirlistBox,1 buah FileListBox,1 buah DriveListBox,1 buah MMcontrol.
4. Susun semua Component seperti ini
5. Lalu masukkan Code nya seperti ini :
Private Sub Dir1_Change()
File1.Path = Dir1
End Sub
Private Sub Drive1_Change()
Dir1 = Drive1.Drive
End Sub
Private Sub File1_Click()
Label1.Caption = File1.FileName
MMControl1.Command = "close"
MMControl1.FileName = File1.Path + "\" + File1.FileName
MMControl1.Command = "open"
MMControl1.Command = "play"
End Sub
Private Sub Form_Load()
MMControl1.BackVisible = False
MMControl1.StepVisible = False
MMControl1.RecordVisible = False
MMControl1.EjectVisible = False
File1.Pattern = "*.mp3"
End Sub
Private Sub MMControl1_Done(NotifyCode As Integer)
Dim a As Integer
On Error GoTo salah
If MMControl1.Position = MMControl1.Length Then
a = File1.ListIndex
a = a + 1
File1.Selected(a) = True
File1_Click
salah:
Exit Sub
End If
End Sub
File1.Path = Dir1
End Sub
Private Sub Drive1_Change()
Dir1 = Drive1.Drive
End Sub
Private Sub File1_Click()
Label1.Caption = File1.FileName
MMControl1.Command = "close"
MMControl1.FileName = File1.Path + "\" + File1.FileName
MMControl1.Command = "open"
MMControl1.Command = "play"
End Sub
Private Sub Form_Load()
MMControl1.BackVisible = False
MMControl1.StepVisible = False
MMControl1.RecordVisible = False
MMControl1.EjectVisible = False
File1.Pattern = "*.mp3"
End Sub
Private Sub MMControl1_Done(NotifyCode As Integer)
Dim a As Integer
On Error GoTo salah
If MMControl1.Position = MMControl1.Length Then
a = File1.ListIndex
a = a + 1
File1.Selected(a) = True
File1_Click
salah:
Exit Sub
End If
End Sub
6. Jalankan dengan menekan tombol F5.
Selesai......
Sekian tutorial Cara membuat aplikasi pemutar musik dari saya.Semoga bermanfaat.
Download Source Code nya Disini
No comments:
Post a Comment