1. Buka program VB 6.0 dan pilih Standart.EXE
2. Masukkan 5 buah CommandButton, 1 buah komponen media player (msdxm.ocx) dan 2 buah ListBox kedalam Form1. Atur Posisinya seperti gambar di bawah ini:
3. Ganti Caption dari setiap tombol menjadi :
4. Masukkan 1 buah Form (Form2) kedalam Projects dan tambahkan 1 buah DriveListbox, 1 buah DirListbox, 2 buah CommandButton dan 1 buah FileListBox kedalam Form2. Atur seperti gambar di bawah ini:
Ubah Caption Command1 = Add dan Caption Command2 = Cancel
Untuk FileListBox ubah Pattern = *.mp3
Tampilan Form2 akan menjadi seperti ini :
5. Masukkan lagi 1 buah Form (Form3) ke dalam Project anda dan tambahkan 1 buah DriveListBox, 1 buah DirListBox, dan 2 buah CommandButton. Atur Seperti gambar di bawah ini:
Ubah Caption Command1 = Add dan Caption Command2 = Cancel
6. Ubah Properties dari Form1, Form2 & Form3
a. Form1
Caption = Mp3 Player
StartUpPosition = 2-Center Screen
b. Form2
Caption = Add File
StartUpPosition = 2-Center Screen
c. Form3
Caption = Add Foler
StartUpPosition = 2-Center Screen
7. Kode/ Listing Form1
Private Sub Command1_Click()
MediaPlayer1.Open List2
End Sub
Private Sub Command2_Click()
MediaPlayer1.Stop
End Sub
Private Sub Command3_Click()
If MediaPlayer1.IsDurationValid = False Then Exit Sub
If Command3.Caption = "Pause" Then
MediaPlayer1.Pause
Command3.Caption = "Resume"
Else
MediaPlayer1.Play
Command3.Caption = "Pause"
End If
End Sub
Private Sub Command4_Click()
Form2.Show
End Sub
Private Sub Command5_Click()
Form3.Show
End Sub
Private Sub List1_Click()
List2.ListIndex = List1.ListIndex
End Sub
Private Sub List1_DblClick()
Command1_Click
End Sub
8. Kode/ Listing Form2
Private Sub Command1_Click()
Form1.List1.AddItem File1
Form1.List2.AddItem Dir1.Path & "\" & File1
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1
End Sub
Private Sub File1_DblClick()
Form1.List1.AddItem File1
Form1.List2.AddItem Dir1.Path & "\" & File1
End Sub
9. Kode/Listing Form3
Private Sub Command1_Click()
Dim a As Long
Dim b As String
If File1.ListCount = "0" Then Exit Sub: MsgBox "No files"
For a& = 0 To File1.ListCount - 1
Form1.List1.AddItem File1.List(a&)
Form1.List2.AddItem Dir1.Path & "\" & File1.List(a&)
Next a
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1
End Sub
8. Test program (tekan F5)
9. Selamat ya... anda sudah berhasil membuat Mp3 player sendiri.
Thanks Ya KAK
BalasHapusKak Mediaplayer1 Ditaruh DIMANA
BalasHapuskeren nih, saya udah nyari lama banged soal artikel ini
BalasHapusyg buat form 3 gk bisa ttu gan
BalasHapusCara membuat mp3 di vb6 | Belajar dan berbagi Tutorial Visual Basic
BalasHapus