Monday, May 28, 2012

Menjalankan File .MP3 Menggunakan Microsoft Multimedia Control

Option Explicit 

Private Sub
Command1_Click()
MMC.FileName = OpenFile
Me.Caption = MMC.FileName
MMC.Command = "open"
MMC.Command = "play"
End Sub

Private Function
OpenFile() As String
With
CommonDialog1
.FileName = ""
.DialogTitle = "Open Files"
.InitDir = "C:\My Documents"
.Filter = "MP3 File (*.MP3)|*.MP3"
.ShowOpen
If .FileName = "" Then Exit Function
MMC.Command = "stop"
OpenFile = .FileName
End With
End Function

Private Sub
Command2_Click()
MMC.Command = "stop"
End Sub