System.Windows.Forms.TreeNode.Remove C# (CSharp) Method

Remove() public method

public Remove ( ) : void
return void
        public void Remove()
        {
            this.Remove(true);
        }

Same methods

TreeNode::Remove ( bool notify ) : void

Usage Example

Example #1
0
        private void AddNode(XmlNode inXmlNode, TreeNode inTreeNode)
        {
            XmlNode xNode;
            TreeNode tNode;
            XmlNodeList nodeList;
            int i;

            // Loop through the XML nodes until the leaf is reached.
            // Add the nodes to the TreeView during the looping process.
            if (inXmlNode.HasChildNodes && inXmlNode.FirstChild.HasChildNodes)
            {
                nodeList = inXmlNode.ChildNodes;
                for (i = 0; i <= nodeList.Count - 1; i++)
                {
                    xNode = inXmlNode.ChildNodes[i];
                    inTreeNode.Nodes.Add(xNode.Name, xNode.Name);
                    tNode = inTreeNode.Nodes[i];
                    AddNode(xNode, tNode);
                }
            }
            else
            {
                // Here you need to pull the data from the XmlNode based on the
                // type of node, whether attribute values are required, and so forth.
                String str = (inXmlNode.InnerText).Trim();
                TreeNode parent = inTreeNode.Parent;
                inTreeNode.Remove();
                parent.Nodes.Add(str, str);
                //inTreeNode.Text = (inXmlNode.InnerText).Trim();
            }
        }
All Usage Examples Of System.Windows.Forms.TreeNode::Remove