在树节点中添加带有事件的按钮 [英] Adding a button with events in Tree Node

查看:175
本文介绍了在树节点中添加带有事件的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有树节点,并且在每个节点上都添加了一个按钮.但是我无法获得按钮的点击事件.

Hi,

I have tree node and I have added a button n every node.But I am not able to get the click event of the button. Please let me know if any answers?

推荐答案

如果这是WinForms中的标准TreeView控件,那么很有可能您不能-TreeNode是不是从Control派生的,因此它不能接受或处理鼠标单击.

您必须通过父级TreeView来处理此问题,然后计算出是否在按钮中(不是手动).
If this is a standard TreeView control in WinForms, then there is a good chance that you can''t - TreeNode is not derived from Control, so it cannot accept or process Mouse clicks.

You would have to handle this via the parent TreeView, and work out if you are in the button or not manually.


这篇关于在树节点中添加带有事件的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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