本文整理汇总了C#中System.Windows.Forms.TreeNode.EndEdit方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.EndEdit方法的具体用法?C# TreeNode.EndEdit怎么用?C# TreeNode.EndEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeNode
的用法示例。
在下文中一共展示了TreeNode.EndEdit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeforeLabelEditEventTest
public void BeforeLabelEditEventTest ()
{
tv.LabelEdit = true;
TreeNode node = new TreeNode ("A");
tv.Nodes.Add (node);
tv.BeforeLabelEdit += new NodeLabelEditEventHandler (BeforeLabelEditHandler);
f.Show ();
node.BeginEdit ();
Assert.IsTrue (node.IsEditing, "#A1");
node.EndEdit (false);
Assert.IsTrue (event_fired, "#B1");
f.Dispose ();
}
示例2: EndEditTest
public void EndEditTest ()
{
TreeNode node1 = new TreeNode ("A");
TreeNode node2 = new TreeNode ("B");
Form f = new Form ();
TreeView tv = new TreeView ();
tv.LabelEdit = true;
tv.Parent = f;
tv.Nodes.Add (node1);
tv.Nodes.Add (node2);
f.Show ();
// EndEdit called on a different node
node1.BeginEdit ();
Assert.AreEqual (true, node1.IsEditing, "#1");
node2.EndEdit (false);
Assert.AreEqual (false, node1.IsEditing, "#2");
node1.BeginEdit ();
Assert.AreEqual (true, node1.IsEditing, "#3");
node2.EndEdit (true);
Assert.AreEqual (false, node1.IsEditing, "#4");
f.Dispose ();
}