1

i am working in treeview in which no option for the child node and parent node click event so plz suggest me to work on Both click event

my code is

  private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
    {
        if (treeView1.SelectedNode = "Edit User")
        {
            label2.Visible = true;

        }
        else
        {
            label2.Visible = false;
        }

    }
3
  • 1
    I am sorry, I have read this question over and over and I really don't know what you are asking, could you be more clear about what you want to happen? Commented Jun 12, 2013 at 10:25
  • NodeMouseClick event could help Commented Jun 12, 2013 at 10:26
  • Btw, you should avoid putting "C#" in your question title, you already have it as a tag Commented Jun 12, 2013 at 10:27

1 Answer 1

2

Try This :

private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
    {
        if (e.Node.Text = "Edit User")
        {
            label2.Visible = true;

        }
        else
        {
            label2.Visible = false;
        }

    }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.