本文整理匯總了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 ();
}