Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In File Browser Program, in TreeView Listing Drives and Folders and after Click TreeView Folder icon then Listing Files and Folders in Listview.

I want to open ChildNodes (in treeview) by Clicking folder icon inside Listview.

I mean to say if there are SubFolders under a Folder and when I click Folder inside Listview same Time open in TreeView to that Subfolder as child Nodes.




is there any way to do this in Vb.Net just with codes (not with an Ocx or etc.) ?

Advanced thanks.

What I have tried:

I found this Code (VB6) but cant convert it into .NET (I am not sure if its correct code)

Dim nodChild As Node
Dim sLVItem As String
          Set nodChild = TreeView1.SelectedItem.Child
          sLVItem = ListView1.SelectedItem
          
          Do While ((nodChild Is Nothing) = False)
            If (nodChild = sLVItem) Then
              nodChild.Selected = True
              Exit Do
            End If
            Set nodChild = nodChild.Next
          Loop
Posted
Comments
Maciej Los 17-Mar-19 6:41am    
Your code is not related to scan folders on HDD. Do you have any code to list all directories on specific drive?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900