• Log in or sign up for an account here: https://www.sythe.org/login

Windows Media Player

Helpful?

  • Yes

    Votes: 0 0.0%
  • A little

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%

  • Total voters
    1

kharg0

Active Member
Joined
Feb 25, 2007
Sythe Gold
0
Messages
131
Windows Media Player
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.:D

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!:cool:
 
arg-highlightedPosts="Array" args="" /> arg-highlightedPosts="Array" args="" />
Windows Media Player
ya i know but this is more recent things that i have done and it simlifies a lot of the codes on that page.
 
arg-highlightedPosts="Array" args="" />
Runescape Gamblingrunescape gambling
Back
Top