kevin shen
September 28th, 2001, 08:15 PM
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
|
Click to See Complete Forum and Search --> : How to remove a node from treeview control? kevin shen September 28th, 2001, 08:15 PM 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 John G Duffy September 30th, 2001, 01:41 PM Treeview1.Nodes.Remove index Index can be a actual number or the nodes key value John G kevin shen September 30th, 2001, 04:07 PM 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 Cimperiali October 1st, 2001, 07:13 AM 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 John G Duffy October 1st, 2001, 10:07 AM 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 codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |