1 Previous Next 

Windows .Net MediaPlayer playing in windows forms


.Net contains a nice player to play MP3 files. A pity is that it is until now not so well documented on MSDN. Here the most simple format to let an MP3 file play in windows forms.
'Add a reference to presenationcore and WindowsBase
Imports System.Windows.Media
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgsHandles MyBase.Load
        Dim MPlayer As New MediaPlayer
        MPlayer.Open(New System.Uri("C:\Test\test.MP3"))
        MPlayer.Play()
    End Sub
End Class



1 Previous Next