Exemple #1
0
        // Delete the clicked node.
        private void ctxNodeDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to delete node " +
                                SelectedNode.Name + "?",
                                "Delete Node?", MessageBoxButtons.YesNo,
                                MessageBoxIcon.Question) == DialogResult.Yes)
            {
                // Delete the node (and its subtree).
                Root.DeleteNode(SelectedNode);

                // Rearrange the tree to show the new structure.
                ArrangeTree();

                // Show the tree's traversals.
                ShowTraversals();
            }
        }