c# - make certain node invisible -


my problem want able set nodes invisible. i've got 2 forms. second 1 filled witch checkboxes named same nodes in first form. after checking 1 of checkboxes want make node in first form invisible. passing data between forms works, because tested messagebox.

code second form (responslibe making nodes invisible):

        private void button1_click(object sender, eventargs e)     {         if (checkbox1.checked == true)         {             form1.a = true;         }           this.close();     } 

code first form contains nodes:

    public static bool a;     public static bool b;      private void categories()     {         if(a == true)             {                 treeview1.nodes[0].isvisible = false;             }      } 

error get:

property or indexer 'system.windows.forms.treenode.isvisible' cannot assigned -- read 

instead of making tree node invisible. think should remove collection when don't want display , have add again if want show it.

you can use remove function remove node

tree.nodes.remove(mynode); 

you can try this

private void categories() {   if(a == true)   {     treeview1.nodes[0].remove();    } } 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -