How can i load a file in the mediaplayer with a openfile dialog? Could someone please gove me a code?
Using the opendialog, you can get the path of the file to be opened. Use this path of the file with the media player control and use the play menthod of the media player to play the file.
I know but everytime i use the name of the mediaplayer it says that its not declared or so. why should i declare that???
Finally i did it. But always when i debug my program is says something like "exeption" und "hresult".What am i doing wrong? Heres my code: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Button1.Enabled = False AxMediaPlayer1.Visible = False End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click AxMediaPlayer1.launchURL(OpenFileDialog1.FileName) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click OpenFileDialog1.ShowDialog() Button1.Enabled = True End Sub End Class PLease help