C# Treeview Doubleclick Windowsforms

Asked

Viewed 69 times

0

private void treeView_DoubleClick(object sender, EventArgs e)
{
    if (pRetorno == true)
    {
        if (treeView.SelectedNode != null)
        {
            pOc = new OcorrenciasCategoriasDAO().Buscar(Convert.ToInt32(treeView.SelectedNode.Tag));
            this.Close();
        }
    }
}

Don’t fall in the event DoubleClick, by double clicking on all treeview area and also we.

  • I did the test here with me and it worked. An observation. If treeview is empty, that is, without at least one knot, it won’t work at all. It is necessary to have some information in treeview, at least one to call the event in question.

  • @pnet you marked me mistakenly. I should have marked the post OP.

  • Now that I saw it. It should be for Marcelo Marin, I’m sorry, man, it was unintentionally.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.