Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Tree View Design help

The below code is the code for my tree view.

Private Sub UserForm_Initialize()
Dim nodX As Node
Dim i As Long
Dim j As Long
Dim k As Long
Dim l As Long
Dim m As Long
Dim n As Long
TreeView1.CheckBoxes = False
With TreeView1.Nodes
.Clear

'Certifacte Name
Set nodX = .Add(, , "CName",
Worksheets("Cert_Details").Range("C_Name").Value)

'Path Name

Set nodX = .Add("CName", tvwChild, "Path",
Worksheets("Cert_Path_module").Range("Path").Value )
nodX.Expanded = True
End With

'Modules (1-5)
With Worksheets("Cert_Path_module")
For i = 1 To 5
With .Range("Module_" & i)
If .Value < "" Then
Set nodX = TreeView1.Nodes.Add("Path", tvwChild, "Mod" &
i, .Value)
End If
End With
Next


End With
nodX.Expanded = True

'Learning Items
With Worksheets("Learning Item1")
For j = 1 To 20
With .Range("LI_" & j)
If .Value < "" Then
Set nodX = TreeView1.Nodes.Add("Mod1", tvwChild, "LI_" &
j, .Value)
End If
End With
Next j
End With
nodX.Expanded = False

With Worksheets("Learning Item2")
For k = 1 To 20
With .Range("LI2_" & k)
If .Value < "" Then
Set nodX = TreeView1.Nodes.Add("Mod2", tvwChild, "LI2_" &
k, .Value)
End If
End With
Next
End With
nodX.Expanded = False

With Worksheets("Learning Item3")
For l = 1 To 20
With .Range("LI3_" & l)
If .Value < "" Then
Set nodX = TreeView1.Nodes.Add("Mod3", tvwChild, "LI3_" &
l, .Value)
End If
End With
Next
End With
nodX.Expanded = False

With Worksheets("Learning Item4")
For m = 1 To 20
With .Range("LI4_" & m)
If .Value < "" Then
Set nodX = TreeView1.Nodes.Add("Mod4", tvwChild, "LI4_" &
m, .Value)
End If
End With
Next
End With
nodX.Expanded = False

With Worksheets("Learning Item5")
For n = 1 To 20
With .Range("LI5_" & n)
If .Value < "" Then
Set nodX = TreeView1.Nodes.Add("Mod5", tvwChild, "LI5_" &
n, .Value)
End If
End With
Next
End With
nodX.Expanded = False

nodX.EnsureVisible

TreeView1.Style = tvwTreelinesPlusMinusText
TreeView1.BorderStyle = ccFixedSingle

End Sub


Now On clicking on each node, I want the node Value to be displayed in
text box 1. And the details of that node in Text box 2 (we get the
node details from the excel sheet). Is it possible to design such a
thing?
Note: Each node will have different values and different details .

Please suggest I'm using the tree view control for the firstime. I got
this idea from the tree view that you will fing in the following link.
http://puremis.net/excel/code/080.shtml

Thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tree view in Excel duxxyy Excel Discussion (Misc queries) 1 March 25th 08 02:24 PM
Help with Tree View functionality..... [email protected] Excel Programming 1 March 29th 07 11:51 AM
tree view Stewart Rogers Excel Programming 1 July 22nd 04 12:58 PM
tree view control Harald Staff Excel Programming 0 June 10th 04 04:07 PM
tree view control julio Excel Programming 0 June 10th 04 03:04 PM


All times are GMT +1. The time now is 05:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"