DirView question
Posted
#1
(In Topic #1248)
Regular

Is there a way to select (in code) a particular directory in the display?
Posted
Guru

bill-lancaster said
Have found DirView a handy way of displaying directories.
Is there a way to select (in code) a particular directory in the display?
Yes by accessing the Dirview's internal TreeView object
If you look at the DirView source code…
comp/src/gb.form/.src/File/DirView.class · master · Gambas / gambas · GitLab
You can see that when it is is created is first adds 1 TreeView object to itself, so the DirView.Children[0] is a TreeView.
So with the above code..
Dim tv As TreeView = DView.Children[0]
tv is the TreeView, you can do all you can with a normal TreeView.
Code (gambas)
Posted
Regular

Thanks Bruce
1 guest and 0 members have just viewed this.


