树视图节点选择 [英] Treeview Node selection

查看:93
本文介绍了树视图节点选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在窗体上有一个Windows.Forms.Treeview对象.如果我在树上扩展了一个节点,该节点将该节点的子级扩展到窗体的底部,那么我不会收到NodeMouseClick事件吗?关于如何使NodeMouseClick事件触发或为什么不触发的任何想法?

I have a Windows.Forms.Treeview object on a Form. If I expand a node on the tree that extends that nodes children past the bottom of the form I do not receive the NodeMouseClick event? Any ideas of what I can do to have the NodeMouseClick event fire, or why it is not?

推荐答案

我知道发生了什么.节点被向上移动并远离鼠标下方,并且在接收到MouseDown后立即发生这种情况.因此,它不接收鼠标键按下事件,因此不能生成NodeMouseClick,因为Click确实需要两个事件:
MouseDown和MouseUp.

至于如何减轻这种情况,我目前还没有任何想法.

只是使情况变得更糟,当您折叠节点并
时也会发生同样的情况 因此,它会从鼠标下方移开.



干杯

Manfred
I know what''s happening. The node is moved upward and away from under the mouse and this happens a soon as the MouseDown is received. Thus it does not receive the mouse key up event and thus cannot generate a NodeMouseClick because a Click does need both events:
MouseDown and MouseUp.

As to how to alleviate this I currently don''t have any idea.

Just to make things worse, same happens when you collapse a node and
it moves away from under the mouse because of that.



Cheers

Manfred


我将使用AfterExpand或BeforeExpand(-Collapse)方法并触发与Click相同的功能.
I would use AfterExpand or BeforeExpand (-Collapse) methods and trigger the same functionality as on Click.


这篇关于树视图节点选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆