• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1088
  • Last Modified:

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
0
YomTovSuccos
Asked:
YomTovSuccos
  • 3
  • 2
  • 2
1 Solution
 
gafoorgkCommented:
Can u please explain a good reason why u want to use TreeView for this instead of using ListView or ms flex grid if u want hierarchical view of items ?

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.
0
 
gafoorgkCommented:
well, kaliyug ka arjun, aapka theer acha hei.  that's a good one but not stable as i used it before.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
kaliyugkaarjunCommented:
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
0
 
YomTovSuccosAuthor Commented:
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
0
 
gafoorgkCommented:
in that case it's better to use msflex grid with disconnected hierarchical recordset as it'll give powerful control over UI.
0
 
YomTovSuccosAuthor Commented:
Iil use VsFlex Grid Thanks A Milion
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now