Jump to content

Listview Help?????

- - - - -

  • Please log in to reply
3 replies to this topic

#1
jbnonn

jbnonn

    Newbie

  • Members
  • PipPip
  • 15 posts
Can someone point me in the right direction. I trying to have a Listview load from a set directory, that I choose. I have been looking for information on the net, but I have not found anything, or just have been to new to c# that I miss it totally. I like To have a Listview be populated with files from a set directory , and then the user can set its look, and then click on it to load it into a Player. Thia is for a media player I'm creating.

#2
CommittedC0der

CommittedC0der

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,565 posts
Maybe Try this code:
DirectoryInfo directory = new DirectoryInfo("C:\\");
            FileInfo[] files = directory.GetFiles();

            foreach (FileInfo file in files)
            {
                ListViewItem item = listView1.Items.Add(file.Name);
                item.ImageIndex = 0;
                item.Tag = file;
            }

Or you can read this.
c# - listview opening directories - Stack Overflow

Good luck with your project. ~ Committed.

A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.

#3
jbnonn

jbnonn

    Newbie

  • Members
  • PipPip
  • 15 posts
Thanks for the Code. But can you help tell me some good places to help understand the listview functions more. I need to change the layout of the files and folders, and the option to change from a list, detail, or icon view. That is a lot of information to ask in a forum, so could someone tell me a good website or something to help understand all the functions of the listView. Thanks.

#4
CommittedC0der

CommittedC0der

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,565 posts
Well from a quick glance these two articles look good.
C# Programming Tutorial - Programming Advanced Winforms in C#
_ Beginners Listview LVW tutorial: Various difernt views, add items WITH ICONS, spreadsheet style! _ by Jon Barker

Good luck ~ Committed.
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users