TreeView example Please.

Posted on 2000-03-17
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 .
Question by:vbRetard
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
1 Comment

Accepted Solution

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


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 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…

739 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