System.Windows.Forms.TreeView.CollapseAll C# (CSharp) Method

CollapseAll() public method

public CollapseAll ( ) : void
return void
        public void CollapseAll()
        {
            for (int i = 0; i < Nodes.Count; i++)
                Nodes[i].CollapseInternal();
            Refresh();
        }
        public void ExpandAll()

Usage Example

Example #1
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     if (toolStripButton1.Text == "Expand All")
     {
         trvBlockSet.ExpandAll();
         toolStripButton1.Text  = "Collapse All";
         toolStripButton1.Image = Properties.Resources.gem_remove;
     }
     else
     {
         trvBlockSet.CollapseAll();
         toolStripButton1.Text  = "Expand All";
         toolStripButton1.Image = Properties.Resources.add_small;
     }
 }
All Usage Examples Of System.Windows.Forms.TreeView::CollapseAll