Solved

TreeView example Please.

Posted on 2000-03-17
1
155 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now