hello guys im new here..hope you can help make my first project in visual basic..i want to make a mp3 player in visual basic without using the WMP OCX.. i have started i downloaded a simple mp3 player without WMP OCX and use it as a reference but since it has no tutorial i have to see the codes 1by1 i cant play my project..here's my code..
[code=vb]
Private Sub CmdBrowse_Click ()
On Error GoTo error
With CDlg1
'On Cancel do nothing
.CancelError = True
.DialogTitle = "Browse For MP3 Files"
.Filter = "MP3 Files (*.mp3) |*.mp3; |Wave Files (*.wav) |*.wav; |Midi Files (*.mid) |*.mid"
.ShowOpen
'Handle no filename
If Len(.FileName) = 0 Then Exit Sub
txtFile.Text = .FileName
CmdPlay.SetFocu s 'Press enter to play
End With
error: 'Do nothing
End Sub
Private Sub CmdPlay_Click()
Play
End Sub
Private Sub TxtFile_Change( )
Dim Ext As String
'Check if there is a string in txtFile
If txtFile <> "" Then
'File extension is the last three letters
Ext = LCase(Right(txt File, 4))
'If extension is supported enable player buttons
If Ext = ".mp3" Or Ext = ".wav" Or Ext = ".mid" Then
CmdPlay.Enabled = True
CmdPause.Enable d = True
CmdStop.Enabled = True
CmdRew.Enabled = True
CmdFF.Enabled = True
chkLoop.Value = 1
End If
Else
'If no file name disable player buttons
CmdPlay.Enabled = False
CmdPause.Enable d = False
CmdStop.Enabled = False
CmdRew.Enabled = False
CmdFF.Enabled = False
chkLoop.Value = 2
End If
End Sub
[/code]
when i open i file i gives a error about thet command "Play" i think theres something wrong about it but in my reference player thats the only command in the CmdPlay button
[code=vb]
Private Sub CmdBrowse_Click ()
On Error GoTo error
With CDlg1
'On Cancel do nothing
.CancelError = True
.DialogTitle = "Browse For MP3 Files"
.Filter = "MP3 Files (*.mp3) |*.mp3; |Wave Files (*.wav) |*.wav; |Midi Files (*.mid) |*.mid"
.ShowOpen
'Handle no filename
If Len(.FileName) = 0 Then Exit Sub
txtFile.Text = .FileName
CmdPlay.SetFocu s 'Press enter to play
End With
error: 'Do nothing
End Sub
Private Sub CmdPlay_Click()
Play
End Sub
Private Sub TxtFile_Change( )
Dim Ext As String
'Check if there is a string in txtFile
If txtFile <> "" Then
'File extension is the last three letters
Ext = LCase(Right(txt File, 4))
'If extension is supported enable player buttons
If Ext = ".mp3" Or Ext = ".wav" Or Ext = ".mid" Then
CmdPlay.Enabled = True
CmdPause.Enable d = True
CmdStop.Enabled = True
CmdRew.Enabled = True
CmdFF.Enabled = True
chkLoop.Value = 1
End If
Else
'If no file name disable player buttons
CmdPlay.Enabled = False
CmdPause.Enable d = False
CmdStop.Enabled = False
CmdRew.Enabled = False
CmdFF.Enabled = False
chkLoop.Value = 2
End If
End Sub
[/code]
when i open i file i gives a error about thet command "Play" i think theres something wrong about it but in my reference player thats the only command in the CmdPlay button
Comment