Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题是 NodeMouseHover 事件仅在鼠标悬停在节点的文本区域上时发生,但我有这样的全行选择树视图:
我应该使用什么事件或者我应该如何更改 NodeMouseHover,所以当鼠标指针悬停在整个节点上而不是文本区域时触发事件?
只需尝试 MouseHover-Event 并获取所选项目:
private void treeView1_MouseHover(object sender, EventArgs e) { TreeNode selNode = (TreeNode)treeView1.GetNodeAt(treeView1.PointToClient(Cursor.Position)); if (selNode != null) { // Do something... } }