Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default treeview add nodes

i want to build a tree form look like
+XX
X1
X2
X3
+YY
Y1
Y2
Y3

i used some codes,

TreeView1.Nodes.Clear
TreeView1.Nodes.Add ([relative], [relationship], [key],
text, [image], [selectedimage])

but i didn't build that form :(

can you help me...¿


p.s.: i use treeview ActiveX control - version 6.0,
from "Control Toolbox"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default treeview add nodes

Su

Private Sub Btn1_Click()
Dim NodX As Node
Dim L As Long

With Treeview1
..Nodes.Clear
Set NodX = .Nodes.Add(, , "Root", "I am Root")
NodX.Expanded = True
Set NodX = Nothing

Set NodX = .Nodes.Add("Root", tvwChild, "XX", "Item XX")
Set NodX = Nothing

For L = 1 To 5
Set NodX = .Nodes.Add("XX", tvwChild, "X" & L, "Item X" & L)
Set NodX = Nothing
Next

Set NodX = .Nodes.Add("Root", tvwChild, "YY", "Item YY")
Set NodX = Nothing

For L = 1 To 5
Set NodX = .Nodes.Add("YY", tvwChild, "Y" & L, "Item Y" & L)
Set NodX = Nothing
Next

End With
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Serkan" skrev i melding
...
i want to build a tree form look like
+XX
X1
X2
X3
+YY
Y1
Y2
Y3

i used some codes,

TreeView1.Nodes.Clear
TreeView1.Nodes.Add ([relative], [relationship], [key],
text, [image], [selectedimage])

but i didn't build that form :(

can you help me...¿


p.s.: i use treeview ActiveX control - version 6.0,
from "Control Toolbox"


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default treeview add nodes

thanks :),


-----Original Message-----
Su

Private Sub Btn1_Click()
Dim NodX As Node
Dim L As Long

With Treeview1
..Nodes.Clear
Set NodX = .Nodes.Add(, , "Root", "I am Root")
NodX.Expanded = True
Set NodX = Nothing

Set NodX = .Nodes.Add("Root", tvwChild, "XX", "Item XX")
Set NodX = Nothing

For L = 1 To 5
Set NodX = .Nodes.Add("XX", tvwChild, "X" & L, "Item X" &

L)
Set NodX = Nothing
Next

Set NodX = .Nodes.Add("Root", tvwChild, "YY", "Item YY")
Set NodX = Nothing

For L = 1 To 5
Set NodX = .Nodes.Add("YY", tvwChild, "Y" & L, "Item Y" &

L)
Set NodX = Nothing
Next

End With
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Serkan" skrev i melding
...
i want to build a tree form look like
+XX
X1
X2
X3
+YY
Y1
Y2
Y3

i used some codes,

TreeView1.Nodes.Clear
TreeView1.Nodes.Add ([relative], [relationship], [key],
text, [image], [selectedimage])

but i didn't build that form :(

can you help me...¿


p.s.: i use treeview ActiveX control - version 6.0,
from "Control Toolbox"


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default treeview add nodes


note that Nodes.Clear can be VERY slow
performance may increase dramatically if replaced with a simple loop:

With treeview1.Nodes
For i = .Count To 0 Step -1
.Remove (i)
Next
End With




keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Serkan" wrote:

thanks :),


-----Original Message-----
Su

Private Sub Btn1_Click()
Dim NodX As Node
Dim L As Long

With Treeview1
..Nodes.Clear
Set NodX = .Nodes.Add(, , "Root", "I am Root")


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
Accessing macro from a system by all other nodes on LAN NSNR Excel Discussion (Misc queries) 1 January 28th 08 02:37 PM
TreeView in Excel VBA [email protected] Excel Discussion (Misc queries) 4 November 8th 06 04:03 PM
x-axis dates dont match up with the nodes on the line graph changetires Charts and Charting in Excel 1 August 11th 06 01:45 PM
TreeView Object bach New Users to Excel 1 August 15th 05 02:51 PM
TreeView: add more than one node to nodes collection Peter[_25_] Excel Programming 3 September 5th 03 12:15 PM


All times are GMT +1. The time now is 04:21 PM.

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

About Us

"It's about Microsoft Excel"