|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Recursion with a Tree View and checkboxesfrom a Cd, Zip, or Floppy. I have the user selected the files they want to copy. Exampe: A:\ (Directory) X - ABC1234 (Folder) X - Test.html (File) X - ZXY4567 (Folder) - WTY5678 (Folder) X - Test2.html (File) X - Budget.xls (File) X = items that the user selects I want to be able to go through all the Tree Nodes and get the files that have been selected. If the folder above the item is not selected I still want the code to go into that folder to see if an item is selected. If someone could point me in the right direction I would greatly appricate it. VBNovice Take a look at this, I just posted it to help someone else. I only needed
to modify the search criteria to send to you. '//Initial usage '//Dim oChecked as Arraylist = Walktree(me.treeview1.nodes) Private Function WalkTree(ByVal PNodes As TreeNodeCollection) As ArrayList Dim oRet As ArrayList, iCount As Integer Dim iTemp As ArrayList oRet = New ArrayList iCount = -1 For Each node As TreeNode In PNodes If node.Checked Then oRet.Add(node) End If iTemp = WalkTree(node.Nodes) oRet.AddRange(iTemp.ToArray) Next Return oRet End Function Show quoteHide quote "VBNovice05" <tony.schroeder.***@mda.mil> wrote in message news:1145979309.080565.113520@v46g2000cwv.googlegroups.com... >I am creating a project that will populate a Tree View with information > from a Cd, Zip, or Floppy. I have the user selected the files they > want to copy. > > Exampe: A:\ (Directory) X > > - ABC1234 (Folder) X > - Test.html (File) X > - ZXY4567 (Folder) > - WTY5678 (Folder) X > - Test2.html (File) X > - Budget.xls (File) > > X = items that the user selects > > I want to be able to go through all the Tree Nodes and get the files > that have been selected. If the folder above the item is not selected I > still want the code to go into that folder to see if an item is > selected. > > If someone could point me in the right direction I would greatly > appricate it. > > VBNovice > AMDRIT,
Thanks for the help it worked just like I wanted to. AMDRIT wrote: Show quoteHide quote > Take a look at this, I just posted it to help someone else. I only needed > to modify the search criteria to send to you. > > '//Initial usage > '//Dim oChecked as Arraylist = Walktree(me.treeview1.nodes) > > Private Function WalkTree(ByVal PNodes As TreeNodeCollection) As ArrayList > > Dim oRet As ArrayList, iCount As Integer > Dim iTemp As ArrayList > > oRet = New ArrayList > iCount = -1 > > For Each node As TreeNode In PNodes > If node.Checked Then > oRet.Add(node) > End If > > iTemp = WalkTree(node.Nodes) > oRet.AddRange(iTemp.ToArray) > > Next > > Return oRet > > End Function > > "VBNovice05" <tony.schroeder.***@mda.mil> wrote in message > news:1145979309.080565.113520@v46g2000cwv.googlegroups.com... > >I am creating a project that will populate a Tree View with information > > from a Cd, Zip, or Floppy. I have the user selected the files they > > want to copy. > > > > Exampe: A:\ (Directory) X > > > > - ABC1234 (Folder) X > > - Test.html (File) X > > - ZXY4567 (Folder) > > - WTY5678 (Folder) X > > - Test2.html (File) X > > - Budget.xls (File) > > > > X = items that the user selects > > > > I want to be able to go through all the Tree Nodes and get the files > > that have been selected. If the folder above the item is not selected I > > still want the code to go into that folder to see if an item is > > selected. > > > > If someone could point me in the right direction I would greatly > > appricate it. > > > > VBNovice > >
"Send To Mail Recipient"
Interesting Results In VB.Net Shared dll paths Accessing Foxpro Database VB.NET reading CSV files (odbc or oledb) position in array using a string Any 'Windows Service' Experts? Why can't I capture the screen?? Error Handling: load text file into TextBox Missing DataGrid crystal report viewer connection |
|||||||||||||||||||||||