Tree control node.
Inheritance: Control
Exemplo n.º 1
0
        /// <summary>
        /// Adds a new child node.
        /// </summary>
        /// <param name="label">Node's label.</param>
        /// <returns>Newly created control.</returns>
        public TreeNode AddNode(string label)
        {
            TreeNode node = new TreeNode(this);
            node.Text = label;
            node.Dock = Pos.Top;
            node.IsRoot = this is TreeControl;
            node.TreeControl = m_TreeControl;

            if (m_TreeControl != null)
            {
                m_TreeControl.OnNodeAdded(node);
            }

            return node;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Handler for node added event.
 /// </summary>
 /// <param name="node">Node added.</param>
 public virtual void OnNodeAdded(TreeNode node)
 {
     node.LabelPressed += OnNodeSelected;
 }