|
-
Mar 7th, 2009, 11:19 PM
#1
Thread Starter
Junior Member
[Solved] ListView items add and General coding problems (Mp3 player)
This problem is now solved, see http://www.vbforums.com/showthread.php?t=560787
I'm working on a simple MP3 player and are stucked on some Treview.Click and Listview.Items.Add problems which I cant seem to get past.
What I'm trying to do is first with a button launch a FolderDialog to get folder path, when this is done I add the directories and subdirectories to tvFolders1 (Treview)
For the whole procedure for this see classes LoadFolderTree(), LoadDir() and tvFolders1_AfterExpand.
This seems to work just fine and no problems as far as I can see
The we add a feature where user click on the Treeview (tvFolders1) and we are supposed to do the following:
On tvFolders1_AfterSelect (when the user actually select something)
I am the trying to add Items and subitems to the lvFiles control (Listview)
Then we go trough the whole procedure of adding:
- Items = File Names
-- SubItems X 4 = ID3 info which we get from
Code:
Me.lvFiles.Items.Add(FileIO.FileSystem.GetName(a))
Next
Dim _N As Integer
With Player
For _N = 0 To .currentPlaylist.count - 1
lvFiles.Items(_N).SubItems.Add((Player.currentPlaylist.Item(_N).getItemInfo("Title")))
See the Class
Code:
Private Sub tvFolders1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvFolders1.AfterSelect
For all the details.
Now adding items and subbitems goes just fine if I:
1. Do not clear the ListView lvFiles in the Class tvFolders1_AfterSelect
But I need that, I want the listview to be cleared before adding new items/subitems or we end up with an enormous list
2. Only add more items to the ListView without doing anything more
What happens:
If I clear the ListView lvFiles in the class tvFolders1_AfterSelect the application will simply freeze and crash after clicking on any item in TreeView tvFolders1
So basically somewhere in my code there is something causing this and that's were I need help, I where hoping someone could figure out what I need to do
I have pasted the whole code for that form because I suspect the problems are not in the adding/clicking on items but somewhere else, I do not know though.
There is also a "bug/another big problem" in the adding of items/subitems to the lvFiles ListView and that is that the first mp3 file only gets added with file/path and not ID3.
I would really appreciate some help with this problem, Thank You
Whole Code (next Post)
Last edited by Tertitten; Mar 8th, 2009 at 06:26 AM.
Reason: [Solved]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|