Media Player PlayList with ListView control
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts
Page 1 of 1
Hi, Now i want to make Media Player PlayList using ListView control
Also i want to display Media Duration, Media Name and File Path in separated columns for all the imported media files in ListView
Want to know how to set colors for media files in ListView?, I mean i want to make to display current playing video file in ListView in red color, And want to display pending video files in pink color, And want to display yellow color for already played videos for Media Player, Like in this screenshot of BlackMagic software
And want to know followings
1. How to make to add media files to ListView, I mean add 1 Button if click that button wants to open OpenFileDialog then after selecting media file(s) want to display in ListView
2. I want to make ListView imported media files to clear them, I mean add 1 Button if click that Button wants to clear all the media files in ListView
3. If click button wants to play all the media files from ListView, I mean add 1 Button and if click that Button wants to play all the songs one by one in Media Player from ListView
4. If click any media file from ListView wants to play it in Media PLayer
Like in this BlackMagic software PlayList screenshot
![Image]()
Please help me
- Kindly
- Tvs Praveen wahooo;
Also i want to display Media Duration, Media Name and File Path in separated columns for all the imported media files in ListView

Want to know how to set colors for media files in ListView?, I mean i want to make to display current playing video file in ListView in red color, And want to display pending video files in pink color, And want to display yellow color for already played videos for Media Player, Like in this screenshot of BlackMagic software
And want to know followings
1. How to make to add media files to ListView, I mean add 1 Button if click that button wants to open OpenFileDialog then after selecting media file(s) want to display in ListView
2. I want to make ListView imported media files to clear them, I mean add 1 Button if click that Button wants to clear all the media files in ListView
3. If click button wants to play all the media files from ListView, I mean add 1 Button and if click that Button wants to play all the songs one by one in Media Player from ListView
4. If click any media file from ListView wants to play it in Media PLayer
Like in this BlackMagic software PlayList screenshot

Please help me

- Kindly

- Tvs Praveen wahooo;
Hello,
Ok this is how you can use a ListView in your application. I wont go into too much detail on how to do everything otherwise I would have made your application for you lol. Youve already made a media player and know how to get track/time information so it should be easy to change it to work with the listview.
The first thing you want to do is add a "ListView" control to your form and use these codes to do the different things that you will need.
You will need some columns in your listview that displays the name of the track, duration and things like that so use this code to create those:
Happy coding cooll;
Ok this is how you can use a ListView in your application. I wont go into too much detail on how to do everything otherwise I would have made your application for you lol. Youve already made a media player and know how to get track/time information so it should be easy to change it to work with the listview.
The first thing you want to do is add a "ListView" control to your form and use these codes to do the different things that you will need.
You will need some columns in your listview that displays the name of the track, duration and things like that so use this code to create those:
Code: Select all
You can add more if you need them but that gives you the idea of how to it. Now to add your data to those columns you will need to use this code to first create a new ListViewItem:ListView1.Columns.Add("Track Name").Width = 200
ListView1.Columns.Add("Track Duration").Width = 150
Code: Select all
Then underneath that you add your data to the track name column like this:Dim Track As New ListViewItem
Code: Select all
And you want to add the duration of the track into the next column so to do that we also add a subitem:Track = ListView1.Items.Add("Track Title")
Code: Select all
You will want to add that into your openfiledialog code when your loading all the files into the listview something like:Track.SubItems.Add("Length of track")
Code: Select all
And that would list all files into the listview aswell as there duration and anything other information you want. If for example you added a 3rd column called "Artist" and you wanted to show that information you would need to add another subitem to that code like this: Dim Track As New ListViewItem
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
For Each strFileName As String In OpenFileDialog1.FileNames
Track = ListView1.Items.Add(strFileName)
Track.SubItems.Add("Length of track")'PLACE YOUR CODE FOR GETTING DURATION IN HERE
Next
End If
Code: Select all
You also asked about how to highlight a track(row) in the listview and to do that you can add this sub anywhere within your code: Dim Track As New ListViewItem
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
For Each strFileName As String In OpenFileDialog1.FileNames
Track = ListView1.Items.Add(strFileName)
Track.SubItems.Add("Length of track")'PLACE YOUR CODE FOR GETTING DURATION IN HERE
Track.SubItems.Add("Artist")'PLACE YOUR CODE FOR GETTING THE ARTIST IN HERE
Next
End If
Code: Select all
And then whenever you want to highlight a specific track (row) to indicate that its playing or in a playlist etc you can call it by using this code line:Public Sub HighlightTrack(ByVal TrackName As String, ByVal HighlightColor As System.Drawing.Color)
Dim TrackList As ListViewItem
TrackList = ListView1.FindItemWithText(TrackName, False, 0)
If Not TrackList Is Nothing Then
ListView1.Focus()
TrackList.BackColor = HighlightColor
TrackList.Selected = True
End If
End Sub
Code: Select all
The "Track Name" is the name of the track you want to highlight and the "Color.Gold" is the color you want to highlight it in. So if you wanted to highlight a track called "Bob the builder" in red you would use:HighlightTrack("Track Name", Color.Gold)
Code: Select all
That should definitely get you started ;)HighlightTrack("Bob the builder", Color.Red)
Happy coding cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
CodenStuff wrote:Hello,Still i can`t figure it out Media Player features like how to add songs to ListView and to display Media Title, Media Total Duration Time, File Path, How to make a Button to play a song from ListView, How to make a Button to play all the songs from ListView
Ok this is how you can use a ListView in your application. I wont go into too much detail on how to do everything otherwise I would have made your application for you lol. Youve already made a media player and know how to get track/time information so it should be easy to change it to work with the listview.
The first thing you want to do is add a "ListView" control to your form and use these codes to do the different things that you will need.
You will need some columns in your listview that displays the name of the track, duration and things like that so use this code to create those:
Code: Select allYou can add more if you need them but that gives you the idea of how to it. Now to add your data to those columns you will need to use this code to first create a new ListViewItem:ListView1.Columns.Add("Track Name").Width = 200 ListView1.Columns.Add("Track Duration").Width = 150
Code: Select allThen underneath that you add your data to the track name column like this:Dim Track As New ListViewItem
Code: Select allAnd you want to add the duration of the track into the next column so to do that we also add a subitem:Track = ListView1.Items.Add("Track Title")
Code: Select allYou will want to add that into your openfiledialog code when your loading all the files into the listview something like:Track.SubItems.Add("Length of track")
Code: Select allAnd that would list all files into the listview aswell as there duration and anything other information you want. If for example you added a 3rd column called "Artist" and you wanted to show that information you would need to add another subitem to that code like this:Dim Track As New ListViewItem If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then For Each strFileName As String In OpenFileDialog1.FileNames Track = ListView1.Items.Add(strFileName) Track.SubItems.Add("Length of track")'PLACE YOUR CODE FOR GETTING DURATION IN HERE Next End If
Code: Select allYou also asked about how to highlight a track(row) in the listview and to do that you can add this sub anywhere within your code:Dim Track As New ListViewItem If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then For Each strFileName As String In OpenFileDialog1.FileNames Track = ListView1.Items.Add(strFileName) Track.SubItems.Add("Length of track")'PLACE YOUR CODE FOR GETTING DURATION IN HERE Track.SubItems.Add("Artist")'PLACE YOUR CODE FOR GETTING THE ARTIST IN HERE Next End If
Code: Select allAnd then whenever you want to highlight a specific track (row) to indicate that its playing or in a playlist etc you can call it by using this code line:Public Sub HighlightTrack(ByVal TrackName As String, ByVal HighlightColor As System.Drawing.Color) Dim TrackList As ListViewItem TrackList = ListView1.FindItemWithText(TrackName, False, 0) If Not TrackList Is Nothing Then ListView1.Focus() TrackList.BackColor = HighlightColor TrackList.Selected = True End If End Sub
Code: Select allThe "Track Name" is the name of the track you want to highlight and the "Color.Gold" is the color you want to highlight it in. So if you wanted to highlight a track called "Bob the builder" in red you would use:HighlightTrack("Track Name", Color.Gold)
Code: Select allThat should definitely get you started ;)HighlightTrack("Bob the builder", Color.Red)
Happy coding cooll;
And to highlight rows with colors
You just given how to highlight rows with names, But i only asked these things to highlight in selected colors following below, But i don`t how to figure it out highlighting rows in selected colors
I mean i want to highlight still pending songs to play to highlight them in Color.Red
To highlight current playing song in Color.Green
To highlight already played songs in Color.Yellow
And really i don`t know to figure it out ListView PlayList, And i don`t know where to add codes and how to start with codes
You just give codes to display media information in separated columns i too like it, But still i can`t figure it out and i don`t how to start
I know well to make features and playlist with ListBox which already learned from your excellent tutorials XD
PLEASE HELP ME TO MAKE THESE FEATURED MEDIA PLAYER PLAYLIST WITH LISTVIEW ALSO TO DISPLAY MEDIA TITLE, TOTAL TIME DURATION, ARTIST, GENRE, FILE PATH IN SEPARATED COLUMNS ALSO TO HIGHLIGHT ROWS WITH SELECTED COLORS
AGAIN AND AGAIN PLEASE HELP ME TO MAKE MEDIA PLAYER WITH LISTVIEW PLAYLIST clapper;
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023