treeview node is highlighted even i did not right click on the node

后端 未结 4 537
孤独总比滥情好
孤独总比滥情好 2021-01-28 11:05

I am working on a winform and on my UI there is a treeview, I found that the treenode will be highlighted even I did not click on the node by right mouse (eg, Node1 will be high

4条回答
  •  清酒与你
    2021-01-28 11:47

    If I understand you correctly you want no node to be selected if the user clicks into empty space within the TreeView. You could accomplish that by handling the MouseDown-Event of the Tree and setting the tree's SelectedNode property to TreeView.GetNodeAt(e.Location).

提交回复
热议问题