well i just started learning VB the other day and im starting on little projects and im on a cd player thing im making using a guideline kinda of and i need you guys to help me get it to work
code:
Private Sub Combo1_Change()
' to determine file type
If ListIndex = 0 Then
File1.Pattern = ("*.wma")
ElseIf ListIndex = 1 Then
File1.Pattern = ("*.mp3")
Else
Fiel1.Pattern = ("*.*")
End If
End Sub
Private Sub Dir1_Change()
'To change directories and subdirectories(or folders and subfolders)
File1.Path = Dir1.Path
If Combo1.ListIndex = 0 Then
File1.Pattern = ("*.wma")
ElseIf Combo1.ListIndex = 1 Then
File1.Pattern = ("*.mp3")
Else
File1.Pattern = ("*.*")
End If
End Sub
Private Sub Drive1_Change()
'To change drives
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
If Combo1.ListIndex = 0 Then
File1.Pattern = ("*.wma")
ElseIf Combo1.ListIndex = 1 Then
File1.Pattern = ("*.mp3")
Else
File1.Pattern = ("*.*")
End If
If Right(File1.Path, 1) <> "\" Then
filenam = File1.Path + "\" + File1.FileName
Else
filenam = File1.Path + File1.FileName
End If
Text1.Text = filenam
End Sub
Private Sub Form_Load()
'To center the Audioplayer startup page
Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2
Combo1.Text = "*.wav"
Combo1.AddItem "*.wma"
Combo1.AddItem "*.mp3"
Combo1.AddItem "All files"
End Sub
Private Sub AudioPlayer_Click()
End Sub
Private Sub Command1_Click()
'To play Windows Media Player file or MPEG layer 3 Audio
If Combo1.ListIndex = 0 Then
AudioPlayer.DeviceType = ".wma"
ElseIf Combo1.ListIndex = 1 Then
AudioPlayer.DeviceType = ".mp3"
End If
AudioPlayer.FileName = Text1.Text
AudioPlayer.Command = "Open"
AudioPlayer.Command = "Play"
End Sub
Private Sub Command2_Click()
If AudioPlayer.Mode = 524 Then Exit Sub
If AudioPlayer.Mode <> 525 Then
AudioPlayer.Wait = True
AudioPlayer.Command = "Stop"
End If
AudioPlayer.Wait = True
AudioPlayer.Command = "Close"
End Sub
Private Sub Command3_Click()
End
End Sub
the part that it says is invalid or w.e that wont make it work is the
BOLD text near the top about the file types