Actually this is how i want
Zones
-Zone1
--- Room1
-- Room2
-Zone2
-- Room1
--Room2
Thanks
Sai Abhiram Bandhakavi
Printable View
Actually this is how i want
Zones
-Zone1
--- Room1
-- Room2
-Zone2
-- Room1
--Room2
Thanks
Sai Abhiram Bandhakavi
:)VB Code:
Option Explicit Private Sub Form_Load() TreeView1.LineStyle = tvwRootLines TreeView1.Sorted = False TreeView1.Style = tvwTreelinesPlusMinusText TreeView1.Nodes.Add , , "Main", "Zones" TreeView1.Nodes.Add "Main", tvwChild, "Zone1", "Zone1" TreeView1.Nodes.Add "Zone1", tvwChild, "Z1Room1", "Room1" TreeView1.Nodes.Add "Zone1", tvwChild, "Z1Room2", "Room2" TreeView1.Nodes.Add "Main", tvwChild, "Zone2", "Zone2" TreeView1.Nodes.Add "Zone2", tvwChild, "Z2Room1", "Room1" TreeView1.Nodes.Add "Zone2", tvwChild, "Z2Room2", "Room2" End Sub
thanks man , its workin really the way i wanted it to be.
i want to show the result as shown below. i want to access the data from database instead of hardcoding.
LocationName
-----------------SuiteName1
----------------------------------Floor1
-------------------------------------------Room 101
-------------------------------------------Room 102
-------------------------------------------Room 10n
----------------------------------Floor2
-------------------------------------------Room 201
-------------------------------------------Room 202
-------------------------------------------Room 20n
----------------------------------Floorn
-------------------------------------------Room 101
-------------------------------------------Room 102
-------------------------------------------Room 10n
-----------------SuiteName2
----------------------------------Floor1
----------------------------------Floor2
----------------------------------Floor3
----------------------------------Floorn
-----------------SuiteNamen
----------------------------------Floor1
----------------------------------Floor2
----------------------------------Floor3
----------------------------------Floorn
hope u understood. Pl help me
Regards
Hiran
hiran3727:
Check out my response (#2 of this thread) :
http://www.vbforums.com/showthread.php?t=387898
I posted an attachment that contains several Treeview examples which you may find helpful.
hi,
i have vb6 in my system. I am not finding MS common controls 6.0 to get the tree view component. pl suggest
hiran
Project > Components > Controls tab > select "Windows Common Controls 6.0" click OK.
hi,
i have used the code which was mentioned in #2. Its working fine. But according to my requirement it is different.
Ex:
Location
Suite
Floor
Room
Under one Location, there will be n number of Suites and under one Suite there will n number of Floor and under one floor there will be n number of rooms.
Once i select Location from the combo box, i want to display its suites, floors and rooms under each child node.
Pl help
regards
Hiran