当前位置: 首页>>代码示例>>C#>>正文


C# TreeNode.BeginEdit方法代码示例

本文整理汇总了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();
 }
开发者ID:BackupTheBerlios,项目名称:flatfour-svn,代码行数:7,代码来源:StructureView.cs

示例2: OnClickAdd

 private void OnClickAdd(object sender, EventArgs e)
 {
     TreeNode newnode = new TreeNode("new");
     treeView1.Nodes.Add(newnode);
     treeView1.LabelEdit = true;
     newnode.BeginEdit();
 }
开发者ID:polserver,项目名称:poltools,代码行数:7,代码来源:SkillGrp.cs

示例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();
 }
开发者ID:Richmandos,项目名称:ebaymaster,代码行数:10,代码来源:FrmMessageTemplate.cs

示例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();
     }
 }
开发者ID:perryofpeek,项目名称:SqlToGraphite-core,代码行数:10,代码来源:HostsTreeViewer.cs

示例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();
            }
        }
开发者ID:jmgilman,项目名称:IPBuddy,代码行数:15,代码来源:FormHandler.cs

示例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();
        }
开发者ID:zhushengwen,项目名称:example-zhushengwen,代码行数:17,代码来源:frmDict.cs

示例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 ();
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:19,代码来源:TreeViewEventsTest.cs

示例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();
            }
        }
开发者ID:perryofpeek,项目名称:SqlToGraphite-core,代码行数:21,代码来源:RoleTreeViewer.cs

示例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();
            }
        }
开发者ID:jmgilman,项目名称:IPBuddy,代码行数:23,代码来源:FormHandler.cs

示例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();
         }
     }
 }
开发者ID:StevenGann,项目名称:TRPG,代码行数:13,代码来源:Form1.cs

示例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 ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:27,代码来源:TreeNodeTest.cs

示例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;
			}
		}
开发者ID:keithshort,项目名称:HOPE,代码行数:62,代码来源:XTree.cs

示例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);
        }
开发者ID:imbavirus,项目名称:TrinityCoreAdmin,代码行数:37,代码来源:RealmManagerForm.cs

示例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();
        }
开发者ID:imbavirus,项目名称:TrinityCoreAdmin,代码行数:12,代码来源:RealmManagerForm.cs

示例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();
		}
开发者ID:aj9251,项目名称:pandorasbox3,代码行数:16,代码来源:Deco.cs


注:本文中的System.Windows.Forms.TreeNode.BeginEdit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。