Solved

TreeView example Please.

Posted on 2000-03-17
1
177 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
[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
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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

624 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