Results 1 to 3 of 3

Thread: Minor Media Player Issue

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2011
    Posts
    65

    Minor Media Player Issue

    Im making a custom Web Browser and the media player works just fone only one issue Ive found is I can use my mouse to select multi music files to add them to the list.

    Code:
    Public Class Form2
    
        Private Sub AddToPlaylistToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToPlaylistToolStripMenuItem.Click
            OpenFileDialog1.ShowDialog()
            AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
        End Sub
    End Class
    I man its a ver basic addon for the browser right now. I just need to be able to add more then one music file to the media player at one time witht he mouse or at lest allow me to hold down ALT and select more then one file. Im sure i made just a simple mistake here.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,479

    Re: Minor Media Player Issue

    the openfiledialog has a multiSelect property, + the windowsMediaPlayer has playlists, so you can select more than 1 movie + add them to the current playlist + they'll be played in the order they were added:

    vb Code:
    1. Public Class Form2
    2.  
    3.     Private Sub AddToPlaylistToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToPlaylistToolStripMenuItem.Click
    4.         'declare new OpenFileDialog + set it's initial properties
    5.         Dim ofd As New OpenFileDialog With { _
    6.         .Title = "Select video files", _
    7.         .Filter = "AVI (*.avi)|*.avi|MPG (*.mpg)|*.mpg|WMV (*.wmv)|*.wmv|All Files (*.*)|*.*", _
    8.         .FilterIndex = 0, _
    9.         .InitialDirectory = IO.Path.Combine(IO.Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.Desktop)).FullName, "Videos"), _
    10.         .Multiselect = True}
    11.         If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
    12.             For Each filename As String In ofd.FileNames
    13.                 Dim movie As WMPLib.IWMPMedia = AxWindowsMediaPlayer1.newMedia(filename)
    14.                 AxWindowsMediaPlayer1.currentPlaylist.appendItem(movie)
    15.             Next
    16.         End If
    17.     End Sub
    18. End Class

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2011
    Posts
    65

    Re: Minor Media Player Issue

    Resolved thnk you.

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