Ok i got some codes that i made myself with a little help from x zero (A little)
Go to your toolbox right click press choose items... When you get in press the com tab then go to almost the bottom where you find windows media player check it and press ok then it will be in your toolbox.
After that has been finished place 2 buttons on your page first one's text as Add and the second ones text as Remove (haven't got remove 2 work)Add a Listview and then add a Menubar and a windows media player control. (organize however you want)double click the menu bar and add file then drop down add Open.
double click the open drop down when you get to its code put it as
i got that from x zero
but added some
nowdouble click add this is where i trail of his tutorial making it easier and with less code.
code as
this will add the file location to your listview (insure how to get it to double click to play send a code please.)
this might work for remove button
so your code should resemble this.
thanks for any one who can help prefect this code!
Go to your toolbox right click press choose items... When you get in press the com tab then go to almost the bottom where you find windows media player check it and press ok then it will be in your toolbox.
After that has been finished place 2 buttons on your page first one's text as Add and the second ones text as Remove (haven't got remove 2 work)Add a Listview and then add a Menubar and a windows media player control. (organize however you want)double click the menu bar and add file then drop down add Open.
double click the open drop down when you get to its code put it as
Code:
Try
OpenFileDialog1.InitialDirectory = "desktop/My Documents"
OpenFileDialog1.ShowDialog()
AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
AxWindowsMediaPlayer1.Ctlcontrols.play()
OpenFileDialog1.Filter = "Supported Media (avi, mid, mp3, mpg, mpeg, mp4, wav, wma, wmv)|*.avi;*.mid;*.mp3; *.mpg; *.mpeg;*.mp4;*.wav;*.wma;*.wmv|Audio Media (*.mid, *.mp3, *.wav, *.wma|*.mid;*.mp3;*.wav;*.wma|Video Media (*.avi, *.mpg, *.mpeg, *.wmv)|*.avi;*.mpg;*.mpeg;*.wmv"
Catch ex As Exception
MessageBox.Show("Some error occur so can't play media", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
i got that from x zero
but added some
nowdouble click add this is where i trail of his tutorial making it easier and with less code.
code as
Code:
Try
OpenFileDialog1.InitialDirectory = "desktop/My Documents"
OpenFileDialog1.ShowDialog()
AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
AxWindowsMediaPlayer1.Ctlcontrols.play()
OpenFileDialog1.Filter = "Supported Media (avi, mid, mp3, mpg, mpeg, mp4, wav, wma, wmv)|*.avi;*.mid;*.mp3; *.mpg; *.mpeg;*.mp4;*.wav;*.wma;*.wmv|Audio Media (*.mid, *.mp3, *.wav, *.wma|*.mid;*.mp3;*.wav;*.wma|Video Media (*.avi, *.mpg, *.mpeg, *.wmv)|*.avi;*.mpg;*.mpeg;*.wmv"
ListView1.Items.Add(OpenFileDialog1.FileName)
Catch ex As Exception
MessageBox.Show("Some error occur so can't play media", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
this will add the file location to your listview (insure how to get it to double click to play send a code please.)
this might work for remove button
Code:
ListView1.SelectedItems.Clear
so your code should resemble this.
Code:
Public Class Form1
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
Try
OpenFileDialog1.InitialDirectory = "desktop/My Documents"
OpenFileDialog1.ShowDialog()
AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
AxWindowsMediaPlayer1.Ctlcontrols.play()
OpenFileDialog1.Filter = "Supported Media (avi, mid, mp3, mpg, mpeg, mp4, wav, wma, wmv)|*.avi;*.mid;*.mp3; *.mpg; *.mpeg;*.mp4;*.wav;*.wma;*.wmv|Audio Media (*.mid, *.mp3, *.wav, *.wma|*.mid;*.mp3;*.wav;*.wma|Video Media (*.avi, *.mpg, *.mpeg, *.wmv)|*.avi;*.mpg;*.mpeg;*.wmv"
Catch ex As Exception
MessageBox.Show("Some error occur so can't play media", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
OpenFileDialog1.InitialDirectory = "desktop/My Documents"
OpenFileDialog1.ShowDialog()
AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
AxWindowsMediaPlayer1.Ctlcontrols.play()
OpenFileDialog1.Filter = "Supported Media (avi, mid, mp3, mpg, mpeg, mp4, wav, wma, wmv)|*.avi;*.mid;*.mp3; *.mpg; *.mpeg;*.mp4;*.wav;*.wma;*.wmv|Audio Media (*.mid, *.mp3, *.wav, *.wma|*.mid;*.mp3;*.wav;*.wma|Video Media (*.avi, *.mpg, *.mpeg, *.wmv)|*.avi;*.mpg;*.mpeg;*.wmv"
ListView1.Items.Add(OpenFileDialog1.FileName)
Catch ex As Exception
MessageBox.Show("Some error occur so can't play media", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListView1.SelectedItems.Clear()
End Sub
thanks for any one who can help prefect this code!

