本文介绍了当用户控件处于活动状态时如何使上下文菜单不可选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我右键单击树视图的节点时,我正在显示一个上下文菜单.假设我的树视图如下

根|-> some.txt |->子级(For some.txt)|-> Child1(Child for Child)

如果我在Child1上单击鼠标右键,则可以选择AddNew.如果用户选择,我将为面板中显示的用户显示用户控制表单.

我需要的是,如果用户选择该选项作为Child1,并且用户控件处于活动状态,并且当用户再次右键单击

I am having a context menu displayed when i right click on a node of a treeview. Suppose my treeview is as follows

Root |->some.txt |-> Child(For some.txt) |-> Child1(child for Child)

If i right click on Child1 i will have an option as AddNew. If the user selects i will show a user control form for the user displayed in a panel.

What i need is if the user selects the option as Child1 and if the user control is active and when the user again right clicks

推荐答案


TreeNode nd= TreeView1.Nodes.AddNode("Sometext.txt");
nd.ContextMenu=ContextMenu1;



除此之外...您正在寻找的是可能有些混乱的澄清信息,我们可以为您提供更多帮助.:confused :: confused :: confused :: confused :: confused :: confused:



other than that ... what you are looking for is a bit confusing may be with clarifications we can help you more.:confused::confused::confused::confused::confused::confused:


这篇关于当用户控件处于活动状态时如何使上下文菜单不可选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 06:04