hello does anyone know how to put codes on the treeview nodes itself..
I want every nodes in the treeview to do different things like opening a new window form if i click one of the nodes and the other nodes to do something else when clicked..

treeview had a NodeMouseClick event when any node clicked this event gets fired. you can get which node clicked from e.Node varaible. it returns a reference to the node that clicked. here is a sample code that show a message box written nodes name on it when you click a node.

private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            MessageBox.Show(e.Node.Text);
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.