My problem is that I want to be able to set certain nodes invisible. I've got two forms. The second one is filled witch checkboxes named same as nodes in first form. After checking one of checkboxes I want to make this node in first form invisible. Passing data between forms works, because I tested it with MessageBox.
Code from second form (Responslibe for making nodes invisible):
private void button1_Click(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
Form1.a = true;
}
this.Close();
}
Code from first form that contains nodes:
public static bool a;
public static bool b;
private void Categories()
{
if(a == true)
{
treeView1.Nodes[0].IsVisible = false;
}
}
Error that I get:
Property or indexer 'System.Windows.Forms.TreeNode.IsVisible' cannot be assigned to -- it is read only