Solved

TreeView example Please.

Posted on 2000-03-17
1
160 Views
Last Modified: 2010-05-02
Hi would anyone have a treeview example how to build nodes ? I tried to find an example on msdn i found some but they didn't explain things well. I need example how to build parent nodes and child. Thanks .
0
Comment
Question by:vbRetard
1 Comment
 
LVL 9

Accepted Solution

by:
Ruchi earned 15 total points
ID: 2629880
I have an example.... Make sure that you put ImageList and TreeView controls on the form.

For ImageList -- 3 images -- label player, check, diamond in the key box.


Option Explicit

Private Sub Form_Load()
Dim nodBB As Node

'Create league
Set nodBB = tvwBaseball.Nodes.Add(, , "Shelby", "North Shelby", "Diamond")
nodBB.Expanded = True
nodBB.Sorted = True

'Create Teams
tvwBaseball.Nodes.Add "Shelby", tvwChild, "Cubs", "Cubs", "Diamond", "Check"
tvwBaseball.Nodes.Add "Shelby", tvwChild, "Marlins", "Marlins", "Diamond", "Check"
tvwBaseball.Nodes.Add "Shelby", tvwChild, "Braves", "Braves", "Diamond", "Check"
tvwBaseball.Nodes.Add "Shelby", tvwChild, "Yankees", "Yankees", "Diamond", "Check"
tvwBaseball.Nodes.Add "Shelby", tvwChild, "Reds", "Reds", "Diamond", "Check"

'Add Players
tvwBaseball.Nodes.Add "Cubs", tvwChild, "Eric", "Eric", "Player"
tvwBaseball.Nodes.Add "Cubs", tvwChild, "Casey", "Casey", "Player"
tvwBaseball.Nodes.Add "Cubs", tvwChild, "Zack", "Zack", "Player"


tvwBaseball.Nodes("Cubs").Sorted = True
End Sub

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS expression Issue finding a string 10 79
Visual Basic Excel Formatting error 4 106
How to make an ADE file by code? 11 87
Problem to With line 4 57
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

810 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