Right click select on .Net TreeNode

前端 未结 3 2331
情歌与酒
情歌与酒 2020-12-30 22:28

I am trying to show a popup menu on my treeview when users right click - allowing them to choose context sensitive actions to apply against the selected node.

At the

3条回答
  •  轮回少年
    2020-12-30 23:08

    Drag a context menu strip onto the form then:

     private void treeView1_MouseDown(object sender, MouseEventArgs e)
     {
       if (e.Button == MouseButtons.Right)
       {
           // Display context menu for eg:
           ContextMenu1.Show();
       }
    }
    

提交回复
热议问题