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;
}
Loading
JohnPosted Jul 3, 2013, 6:43 PM
Works In a similar way so far. If any one got a better solution though. I'm open ears.
Cheers
JohnPosted Jul 3, 2013, 6:33 PM
Sanjeeb LenkaPosted Jul 3, 2013, 1:20 PM
http://stackoverflow.com/questions/6239544/c-sharp-how-to-populate-treeview-with-file-system-directory-structure