Exemple #1
0
        /// <summary>
        /// Creates a <see cref="ToolStripItem"/> which is bound to the action of expanding
        /// the <see cref="TreeNode"/>.
        /// </summary>
        /// <returns>The created <see cref="ToolStripItem"/>.</returns>
        public ToolStripItem CreateExpandAllItem()
        {
            var toolStripMenuItem = new ToolStripMenuItem(Resources.Expand_all)
            {
                ToolTipText = Resources.Expand_all_ToolTip,
                Image       = Resources.ExpandAllIcon,
                Enabled     = treeViewControl.CanExpandOrCollapseForData(dataObject)
            };

            toolStripMenuItem.Click += (s, e) => treeViewControl.TryExpandAllNodesForData(dataObject);
            return(toolStripMenuItem);
        }