|
-
September 28th, 2001, 08:15 PM
#1
How to remove a node from treeview control?
I try to use remove or clear method, but VB always show compile error. Maybe I don't know how to use it. I wonder if anyone can help. Thx.
Best Regards,
Kevin Shen
Best Regards,
Kevin Shen
-
September 30th, 2001, 01:41 PM
#2
Re: How to remove a node from treeview control?
Treeview1.Nodes.Remove index
Index can be a actual number or the nodes key value
John G
-
September 30th, 2001, 04:07 PM
#3
Re: How to remove a node from treeview control?
I tried
Treeview1.Nodes.Remove index
Treeview1.Nodes.Remove keyvalue
it doesn't work, compiler show "expected: end of statement"
Thanks!
Best Regards,
Kevin Shen
Best Regards,
Kevin Shen
-
October 1st, 2001, 07:13 AM
#4
Re: How to remove a node from treeview control?
private Sub Command1_Click()
Dim intX as Integer
With TreeView1
for intX = 0 to 10
.Nodes.Add , , "a" & intX, "a" & intX
next
End With
TreeView1.Nodes.Remove (2) 'the second node, which is "a1"
TreeView1.Nodes.Remove ("a9")
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
October 1st, 2001, 10:07 AM
#5
Re: How to remove a node from treeview control?
You need to replace index with the number of the node you wish to delete or replace keyvalue with the nodes key you used at the time you created the node. Boith the examples below worked fine for me
TreeView1.Nodes.Remove 100 ' Remove node 100
Treeview1.Nodes.Remove "ApplX" ' Remove node called ApplX
John G
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|