如何在mfc中禁用和启用treecontrol的labeledit属性 [英] How to disable and enable treecontrol's labeledit property in mfc

查看:130
本文介绍了如何在mfc中禁用和启用treecontrol的labeledit属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MFC中遇到了一个问题,我想要做的只是当我右键单击节点弹出一个菜单添加新节点并编辑我的树节点时,但是现在即使我保持一个节点一段时间,它仍然可以编辑节点标签,所以我应该怎么做才能禁用标签编辑属性,当我右键单击节点启用标签编辑属性时。如果有人可以帮助我,我将不胜感激。

I met a problem in MFC, what I want to do is only when I right click the node to popup a menu to add new node and edit my tree nodes,but now even I stay one node for a while ,it still can edit node label, so what should I do to disable label edit property and when I right click nodes to enable label edit property.If anyone can help me out, I will be appreciate.

推荐答案

您可以使用TVN_BEGINLABELEDIT通知在不需要时取消编辑。



MSDN上的详细信息:

TVN_BEGINLABELEDIT通知代码(Windows)
You can use the TVN_BEGINLABELEDIT notification to cancel the edit when unwanted.

more details at MSDN:
TVN_BEGINLABELEDIT notification code (Windows)


设置一个bool变量isLabelEdit来控制启用和禁用标签编辑属性的时间
set a bool variable isLabelEdit to control what time to enable and disable label edit property


这篇关于如何在mfc中禁用和启用treecontrol的labeledit属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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