YomTovSuccos
asked on
How can I create 3 columns in a TreeView in VB6?
I would like to create 3 columns in a TreeView, where all the rows are Left justified one below the other, and the following is the sample code I used:
Set nodx = TreeView1.Nodes.Add(nodr, tvwChild, , "Rs.Name" & vbTab & "Rs.date" & vbTab & "Rs.Amount")
The vbTab is not good, because it returns a character that is from a different language. To put in spaces will not either be good, because the rows will not be properly aligned.
Please advise me how to work around this.
Thank you.
Yom Tov Succos
Set nodx = TreeView1.Nodes.Add(nodr, tvwChild, , "Rs.Name" & vbTab & "Rs.date" & vbTab & "Rs.Amount")
The vbTab is not good, because it returns a character that is from a different language. To put in spaces will not either be good, because the rows will not be properly aligned.
Please advise me how to work around this.
Thank you.
Yom Tov Succos
well, kaliyug ka arjun, aapka theer acha hei. that's a good one but not stable as i used it before.
Well..if u want then u can try this freeware
ActiveX tree control 3.12.65 from this link..
http://www.programmersheaven.com/zone15/cat234/29074.htm
ActiveX tree control 3.12.65 from this link..
http://www.programmersheaven.com/zone15/cat234/29074.htm
ASKER
Can u please explain a good reason why u want to use TreeView for this
I Need to use
nodx.Expanded = True
or
nodx.Expanded = False
I Need to use
nodx.Expanded = True
or
nodx.Expanded = False
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Iil use VsFlex Grid Thanks A Milion
u can create as much columns as u want in ListView. TreeView, by it's nature, doesn't support columns. do the following for list view
Dim lvwli As ListItem
With ListView1
.View = lvwReport
With .ColumnHeaders
.Add , "colName", "Name"
.Add , "colDate", "Date"
.Add , "colAmt", "Amount"
End With
Set lvwli = .ListItems.Add(, , "My Name")
lvwli.SubItems(1) = "A Date"
lvwli.SubItems(2) = "An Amount"
End With
if u want hierarchical view, create a custom disconnected recordset with the hierarchy u want and bind it with a flex grid. it is much more powerful. if u want help on creating hierarchical disconnected recordset, lemme know.