This is my code, and i dont get repeat to work.
I think i did something wrong with last code.
vb Code:
Option Explicit Private Sub Command1_Click() ' Browse button (works perfectly) Me.CommonDialog1.Filter = "MP3 Files (*.mp3)|*.mp3|WAV Files (*.wav)|*.wav|MPG Movies (*.mpg)|*.mpg|AVI Movies (*.avi)|*.avi" Me.CommonDialog1.ShowOpen If Me.CommonDialog1.FileName <> "" Then Me.MediaPlayer1.FileName = Me.CommonDialog1.FileName Me.MediaPlayer1.Play Else MsgBox "Select a file first." End If End Sub Private Sub Command2_Click() ' Hides the window music.Hide End Sub Private Sub command3_click() ' Changes caption when click repeat box If (Command3.Caption = "Repeat (off)") Then Command3.Caption = "Repeat (on)" ElseIf (Command3.Caption = "Repeat (on)") Then Command3.Caption = "Repeat (off)" End If End Sub Private Sub mediaplayer1_done() ' Should repeat, but wont work :S If (Me.Command3.Caption = "Repeat (off)") Then Me.MediaPlayer1.Stop ElseIf (Me.Command3.Caption = "Repeat (on)") Then Me.MediaPlayer1.FileName = Me.CommonDialog1.FileName Me.MediaPlayer1.Play End If End Sub
Thanks,
Marius




Reply With Quote