Results 1 to 11 of 11

Thread: [Resolved] mediaplayer1 repeat

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2007
    Posts
    110

    Resolved [Resolved] mediaplayer1 repeat

    This is my code, and i dont get repeat to work.
    I think i did something wrong with last code.


    vb Code:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click() ' Browse button (works perfectly)
    4.     Me.CommonDialog1.Filter = "MP3 Files (*.mp3)|*.mp3|WAV Files (*.wav)|*.wav|MPG Movies (*.mpg)|*.mpg|AVI Movies (*.avi)|*.avi"
    5.     Me.CommonDialog1.ShowOpen
    6.     If Me.CommonDialog1.FileName <> "" Then
    7.         Me.MediaPlayer1.FileName = Me.CommonDialog1.FileName
    8.         Me.MediaPlayer1.Play
    9.     Else
    10.         MsgBox "Select a file first."
    11.     End If
    12. End Sub
    13.  
    14. Private Sub Command2_Click() ' Hides the window
    15.     music.Hide
    16. End Sub
    17.  
    18.  
    19. Private Sub command3_click() ' Changes caption when click repeat box
    20.     If (Command3.Caption = "Repeat (off)") Then
    21.         Command3.Caption = "Repeat (on)"
    22.     ElseIf (Command3.Caption = "Repeat (on)") Then
    23.         Command3.Caption = "Repeat (off)"
    24.     End If
    25. End Sub
    26.  
    27. Private Sub mediaplayer1_done() ' Should repeat, but wont work :S
    28. If (Me.Command3.Caption = "Repeat (off)") Then
    29.     Me.MediaPlayer1.Stop
    30. ElseIf (Me.Command3.Caption = "Repeat (on)") Then
    31.     Me.MediaPlayer1.FileName = Me.CommonDialog1.FileName
    32.     Me.MediaPlayer1.Play
    33. End If
    34. End Sub

    Thanks,
    Marius
    Last edited by Mariuswb; Jul 30th, 2007 at 04:34 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width