Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I create 3 columns in a TreeView in VB6?

Posted on 2006-06-28
7
Medium Priority
?
992 Views
Last Modified: 2012-05-05
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
Comment
Question by:YomTovSuccos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 3

Expert Comment

by:gafoorgk
ID: 17006877
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
 
LVL 3

Expert Comment

by:gafoorgk
ID: 17007037
well, kaliyug ka arjun, aapka theer acha hei.  that's a good one but not stable as i used it before.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Expert Comment

by:kaliyugkaarjun
ID: 17007424
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
 

Author Comment

by:YomTovSuccos
ID: 17012557
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
 
LVL 3

Accepted Solution

by:
gafoorgk earned 2000 total points
ID: 17013377
in that case it's better to use msflex grid with disconnected hierarchical recordset as it'll give powerful control over UI.
0
 

Author Comment

by:YomTovSuccos
ID: 17018958
Iil use VsFlex Grid Thanks A Milion
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question