本文整理汇总了C#中System.Windows.Forms.TreeNode.BeginEdit方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.BeginEdit方法的具体用法?C# TreeNode.BeginEdit怎么用?C# TreeNode.BeginEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeNode
的用法示例。
在下文中一共展示了TreeNode.BeginEdit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NewActor
public void NewActor(Actor actor)
{
TreeNode node = new TreeNode("Actor");
this.Nodes.Add(node);
this.SelectedNode = node;
node.BeginEdit();
}
示例2: OnClickAdd
private void OnClickAdd(object sender, EventArgs e)
{
TreeNode newnode = new TreeNode("new");
treeView1.Nodes.Add(newnode);
treeView1.LabelEdit = true;
newnode.BeginEdit();
}
示例3: buttonAddMessageTemplateCategory_Click
// Add message template category button handler.
private void buttonAddMessageTemplateCategory_Click(object sender, EventArgs e)
{
this.treeViewMessageTemplate.LabelEdit = true;
TreeNode newNode = new TreeNode();
newNode.Text = "新消息模板";
this.treeViewMessageTemplate.Nodes.Add(newNode);
this.treeViewMessageTemplate.SelectedNode = newNode;
newNode.BeginEdit();
}
示例4: AddLabelOnClick
private void AddLabelOnClick(object sender, EventArgs e)
{
if (this.nodeMouseClickSelectedNode.Level == 0)
{
var treeNode = new TreeNode("NewHost");
this.nodeMouseClickSelectedNode.Nodes.Add(treeNode);
treeNode.ExpandAll();
treeNode.BeginEdit();
}
}
示例5: AddNewSiteToTree
public static void AddNewSiteToTree(TreeView tree)
{
Site site = new Site{Name = "Site Name"};
TreeNode siteNode = new TreeNode(site.Name);
siteNode.Tag = site;
siteNode.ContextMenuStrip = frmMain.StaticContextSite;
tree.LabelEdit = true;
tree.Nodes.Add(siteNode);
if (!siteNode.IsEditing)
{
siteNode.BeginEdit();
}
}
示例6: AddDictClass
private void AddDictClass()
{
this.treeDict.LabelEdit = true;
TreeNode newNode;
newNode = new TreeNode();
newNode.Name = this.treeDict.Nodes.Count.ToString ();
newNode.Text = rm.GetString ("Label19");
newNode.ImageIndex = 1;
newNode.SelectedImageIndex = 1;
this.treeDict.Nodes["nodDict"].Nodes.Add(newNode);
//this.treeDict.SelectedNode =newNode ;
newNode.BeginEdit();
newNode = null;
//this.listDict.Items.Clear();
}
示例7: 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 ();
}
示例8: AddLabelOnClick
private void AddLabelOnClick(object sender, EventArgs e)
{
if (this.IsAFrequency())
{
this.nodeMouseClickSelectedNode.ExpandAll();
var treeNode = new TreeNode("120");
this.nodeMouseClickSelectedNode.Nodes.Add(treeNode);
//treeNode.ExpandAll();
treeNode.BeginEdit();
// this.nodeMouseClickSelectedNode.ExpandAll();
// this.nodeMouseClickSelectedNode.Parent.ExpandAll();
}
if (this.IsARole())
{
var treeNode = new TreeNode("NewRole");
this.nodeMouseClickSelectedNode.Nodes.Add(treeNode);
//treeNode.ExpandAll();
treeNode.BeginEdit();
}
}
示例9: AddNewNAEToTree
public static void AddNewNAEToTree(TreeView tree, TreeNode siteNode)
{
NAE nae = new NAE { Name = "New NAE" };
TreeNode naeNode = new TreeNode(nae.Name);
naeNode.Tag = nae;
naeNode.ContextMenuStrip = frmMain.StaticContextNAE;
if (!(siteNode.Tag is Site))
{
// Throw error
}
Site site = (Site)siteNode.Tag;
site.NAEs.Add(nae);
siteNode.Nodes.Add(naeNode);
tree.LabelEdit = true;
if (!naeNode.IsEditing)
{
naeNode.BeginEdit();
}
}
示例10: treeView1_MouseDown
private void treeView1_MouseDown(object sender, MouseEventArgs e)
{
mySelectedNode = treeViewItems.GetNodeAt(e.X, e.Y);
if (mySelectedNode != null)
{
treeViewItems.SelectedNode = mySelectedNode;
treeViewItems.LabelEdit = true;
if (!mySelectedNode.IsEditing)
{
mySelectedNode.BeginEdit();
}
}
}
示例11: 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 ();
}
示例12: OnMouseDown
/// <summary>
/// Handles clicking on a node and either editing the label (double click) or
/// calling the controller's Select method.
/// </summary>
/// <param name="e"></param>
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
selNode = GetNodeAt(e.Location);
if (selNode != null)
{
if (e.Button == MouseButtons.Left)
{
if (e.Clicks == 2)
{
if (TreeDoubleClick != null)
{
TreeDoubleClick(this, EventArgs.Empty);
}
}
// clicked twice on the same node?
if (selNode == SelectedNode)
{
// Is writeable?
if (!((NodeInstance)selNode.Tag).NodeDef.IsReadOnly)
{
// Not currently editing?
if (!selNode.IsEditing)
{
// Then begin edit of the label.
LabelEdit = true;
selNode.BeginEdit();
}
}
else
{
// Re-select the same node, in case we're binding to a property grid that has
// displayed some other information, we now want to update any dependent controls.
((NodeInstance)selNode.Tag).Instance.Select(selNode);
}
}
else
{
// Clicked on a different node. Select it and call
// the controller's Select method.
SelectedNode = selNode;
((NodeInstance)selNode.Tag).Instance.Select(selNode);
}
}
else
{
// Other mouse button. Still select the node.
SelectedNode = selNode;
((NodeInstance)selNode.Tag).Instance.Select(selNode);
}
// Get the backing node instance of the selected node.
selectedNodeInstance = ((NodeInstance)SelectedNode.Tag).Instance;
}
}
示例13: btnNewRealm_Click
private void btnNewRealm_Click(object sender, EventArgs e)
{
TreeNode selectedNode = treeServers.SelectedNode;
Server parentServer;
if (selectedNode.Tag.GetType() == typeof(Realm))
{
parentServer = (Server)selectedNode.Parent.Tag;
selectedNode = selectedNode.Parent;
}
else
{
parentServer = (Server)selectedNode.Tag;
}
if (treeServers.SelectedNode.Tag.GetType() == typeof(Realm))
UpdateRealm((Realm)treeServers.SelectedNode.Tag);
if (treeServers.SelectedNode.Tag.GetType() == typeof(Server))
UpdateServer((Server)treeServers.SelectedNode.Tag);
ClearTextBoxes(panelSQL);
numSQLPort.Value = 3306;
ServerManager.Status = RealmsStatus.NEW;
TreeNode newNode = new TreeNode("Neuer Realm");
Realm newRealm = new Realm();
newNode.Tag = newRealm;
parentServer.realms.Add(newRealm);
selectedNode.Nodes.Add(newNode);
treeServers.SelectedNode = newNode;
newNode.BeginEdit();
SetEnabledControls(panelSQL, true);
}
示例14: btnNewServer_Click
private void btnNewServer_Click(object sender, EventArgs e)
{
TreeNode newNode = new TreeNode("Neuer Server");
Server newServer = new Server();
newNode.Tag = newServer;
ServerManager.servers.Add(newServer);
treeServers.Nodes.Add(newNode);
treeServers.SelectedNode = newNode;
newNode.BeginEdit();
}
示例15: cmCustomCat_Click
/// <summary>
/// The user adds a new category to the custom items
/// </summary>
private void cmCustomCat_Click(object sender, System.EventArgs e)
{
TreeNode n = new TreeNode( "New Category" );
// Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
n.Tag = new List<object>();
// Issue 10 - End
tCat.Nodes[ 0 ].Nodes.Add( n );
tCat.SelectedNode = n;
n.BeginEdit();
}