John

John

  • NA
  • 43
  • 34k

Searching Directories and putting results in a treeview

Jul 3 2013 1:04 PM
Hi, All

I'm currently redeveloping a  program I have where I used a txtBox and lstBox to search several directories. It works fine but now I am looking to convert the lstbox to a treeview. Is there anyway that this is possible? Ive tried treeView1.Nodes.Find(); but no luck as of yet.

my old code is:

void fileInfoDelegate()
        {
            myBooks.Sort(
                delegate(FileInfo a, FileInfo b)
                {
                    return a.Name.CompareTo(b.Name);
                });
        }

private void button10_Click(object sender, EventArgs e)
        {
           
            myBooks.AddRange(new DirectoryInfo(Path.GetDirectoryName(Application.ExecutablePath)).GetFiles("*" + textBox1.Text + "*", SearchOption.AllDirectories));
            textBox1.Text.IndexOf(textBox1.Text, StringComparison.OrdinalIgnoreCase);
           
            fileInfoDelegate();
            listBox1.DataSource = myBooks;

        }


Answers (3)