First timer here and a complete newbie heh..
I' jumped right in and are trying to learn C#, and i'v bin struggling whit a TreeView / ListBox solution the last couple of days and now i have to aske..
This is how i Populate the Treeview:
This is how i Populate the Treeview:
|
it's looking in a fixed directory (whit sub folders) for mp3 files.. this works.
now the big question from here..
I got a ListBox that has to become the playlist, sow i got button to add a selected TreeView Node over to ListBox
as you can see above i have a t.Text and a t.Tag, t.text holde the file name and t.Tag the FullPath
how do i get Text and FullPath into my ListBox as a Item ? i hav tryed DisplayMember and ValueMember :
|
lbPlaylist is the ListBoxcan anyone of you help here ?
is ther i a better way ?
and please.. remember im a complete newbie :)
Hirendra SisodiyaPosted Apr 9, 2010, 7:16 AM
Hello John
you can also used ListView control instead of listbox
Add listview and set it's property 'View' to list
and use this code:
ListViewItem lstitem = new ListViewItem();
lstitem.Text = tvMedia.SelectedNode.Text;
lstitem.Tag = tvMedia.SelectedNode.Tag;
listView1.Items.Add(lstitem);
thanks
Please mark as answere if it helps
JohnPosted Apr 9, 2010, 4:09 AM
sow that t.Text will be shown in the ListBox and t.Tag (the fullpath to the file) to send to
the player part on selected (in ListBox)..
Hirendra SisodiyaPosted Apr 9, 2010, 3:18 AM
you can use item.add property of listboxforadding treeview node text or tag like this:
lbPlaylist .Items.Add(tvMedia.SelectedNode.Text)
lbPlaylist .Items.Add(tvMedia.SelectedNode.Tag)
thanks
Please mark as answere if it helps