treeview esc
void treeType_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
&leftsign;
Console.WriteLine(e.Label);
if (e.Label==null)
&leftsign;
e.Node.EndEdit(true);
e.Node.Remove();
&rightsign;
CancelEdit 获取或设置指示是否已取消编辑的值。
Label 获取与树节点关联的新文本。
Node 获取包含待编辑文本的树节点。
如果用户按 Esc 取消编辑或没有修改标签文本就按 Enter,此属性的值则为 nullNothingnullptrnull 引用(在 Visual Basic 中为 Nothing)。如果用户编辑标签文本,此属性的值则为新的标签文本。即使编辑的标签文本最后的值与其原始值相同,也是如此。
~
I suggest that you set a flag in the BeforeLabelEdit event and reset the
flag in AfterlabelEdit. In KeyDown if flag and KeyCode=vbEscape then you
remove the Node.
Another method is just to add the node with a default name and have the user
to delete the node if he wants to. I believe this is more like the Windows
style.
Leif H
我在treeView中新增节点,并把它处于可编辑状态。但如果我想用Esc键退出新增节点的编辑状态,并把它删除,就调用了treeview的 keydown事件。但如何在treeview的AfterLabelEdit中调用keydown事件呢?请高手指点!!!!!
历史博文
- 20090812 KIS2010 WIN2003 - 2009
- 20090813 Wordpress cms BBtheme 修改 - 2009
- 20090812 xml rpc comodo - 2009
- 20090807 Godaddy gegehost - 2009
- 20090807 双飞燕 G7630 电池 - 2009
- 20090807 c# WebBrowser NewWindow2 - 2009
- 20090807 c# Parent Process - 2009
- 20090803 長沙 益阳 印象 - 2009
- 20090803 益阳 丧俗 - 2009
- 20090803 母系 亲戚 外婆 - 2009