CreateTreeNode() public method

Creates a tree node and add it to the TreeNodeCollection.
public CreateTreeNode ( string text, string path, bool addDummyNode, bool forceChecked, bool isSpecialFolder ) : TreeNodePath
text string The text displayed in the label of the tree node.
path string The path the node represents.
addDummyNode bool True to add + sign, otherwise no + sign appears.
forceChecked bool True to check node in each case, otherwise false to allow normal check against selected paths.
isSpecialFolder bool Specifies if this node is a special folder. Special folders do not request data from the attached data provider.
return TreeNodePath
示例#1
0
        /// <summary>
        ///   Creates a new node and assigns a icon
        /// </summary>
        /// <param name = "helper"></param>
        /// <param name = "text"></param>
        /// <param name = "path"></param>
        /// <param name = "addDummyNode"></param>
        /// <param name = "forceChecked"></param>
        /// <returns></returns>
        protected virtual TreeNodePath CreateTreeNode(TreeViewFolderBrowserHelper helper, string text, string path,
                                                      bool addDummyNode, bool forceChecked, bool isSpecialFolder)
        {
            TreeNodePath node = helper.CreateTreeNode(text, path, addDummyNode, forceChecked, isSpecialFolder);

            try
            {
                SetIcon(helper.TreeView, node);
            }
            catch
            {
                node.ImageIndex         = -1;
                node.SelectedImageIndex = -1;
            }
            return(node);
        }
 /// <summary>
 ///   Creates a new node and assigns a icon
 /// </summary>
 /// <param name = "helper"></param>
 /// <param name = "text"></param>
 /// <param name = "path"></param>
 /// <param name = "addDummyNode"></param>
 /// <param name = "forceChecked"></param>
 /// <returns></returns>
 protected virtual TreeNodePath CreateTreeNode(TreeViewFolderBrowserHelper helper, string text, string path,
     bool addDummyNode, bool forceChecked, bool isSpecialFolder)
 {
     TreeNodePath node = helper.CreateTreeNode(text, path, addDummyNode, forceChecked, isSpecialFolder);
       try
       {
     SetIcon(helper.TreeView, node);
       }
       catch
       {
     node.ImageIndex = -1;
     node.SelectedImageIndex = -1;
       }
       return node;
 }