怎么实现点击treeview当前节点触发事件

2025-01-02 20:41:38
推荐回答(1个)
回答1:

private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
string text=e.Node.Text;
switch(text)
{
case "B":
MessgeBox.Show("BBBBB");
break;
case "C":
MessgeBox.Show("CCCC");
break;
case "D":
MessgeBox.Show("DDDD");
break;
}
}