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


C# TreeNode.AddRangeNodes方法代码示例

本文整理汇总了C#中System.Windows.Forms.TreeNode.AddRangeNodes方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.AddRangeNodes方法的具体用法?C# TreeNode.AddRangeNodes怎么用?C# TreeNode.AddRangeNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.TreeNode的用法示例。


在下文中一共展示了TreeNode.AddRangeNodes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnLoad

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            var treeNode1 = new TreeNode("Node0");
            var treeNode2 = new TreeNode("Node5");
            var treeNode3 = new TreeNode("Node8");
            var treeNode4 = new TreeNode("Node9");
            var treeNode5 = new TreeNode("Node10");
            var treeNode6 = new TreeNode("Node6");
            treeNode6.AddRangeNodes(new TreeNode[]
            {
                treeNode3,
                treeNode4,
                treeNode5
            });
            var treeNode7 = new TreeNode("Node7");
            var treeNode8 = new TreeNode("Node1");
            treeNode8.AddRangeNodes(new TreeNode[]
            {
                treeNode2,
                treeNode6,
                treeNode7
            });
            var treeNode9 = new TreeNode("Node2");
            var treeNode10 = new TreeNode("Node11");
            var treeNode11 = new TreeNode("Node12");
            var treeNode12 = new TreeNode("Node14");
            var treeNode13 = new TreeNode("Node19");
            var treeNode14 = new TreeNode("Node20");
            var treeNode15 = new TreeNode("Node17");
            treeNode15.AddRangeNodes(new TreeNode[]
            {
                treeNode13,
                treeNode14
            });
            var treeNode16 = new TreeNode("Node18");
            var treeNode17 = new TreeNode("Node15");
            treeNode17.AddRangeNodes(new TreeNode[]
            {
                treeNode15,
                treeNode16
            });
            var treeNode18 = new TreeNode("Node16");
            var treeNode19 = new TreeNode("Node13");
            treeNode19.AddRangeNodes(new TreeNode[]
            {
                treeNode12,
                treeNode17,
                treeNode18
            });
            var treeNode20 = new TreeNode("Node3");
            treeNode20.AddRangeNodes(new TreeNode[]
            {
                treeNode10,
                treeNode11,
                treeNode19
            });
            var treeNode21 = new TreeNode("Node4");

            treeNode1.Name = "Node0";
            treeNode1.Text = "Node0";
            treeNode2.Name = "Node5";
            treeNode2.Text = "Node5";
            treeNode3.Name = "Node8";
            treeNode3.Text = "Node8";
            treeNode4.Name = "Node9";
            treeNode4.Text = "Node9";
            treeNode5.Name = "Node10";
            treeNode5.Text = "Node10";
            treeNode6.Name = "Node6";
            treeNode6.Text = "Node6";
            treeNode7.Name = "Node7";
            treeNode7.Text = "Node7";
            treeNode8.Name = "Node1";
            treeNode8.Text = "Node1";
            treeNode9.Name = "Node2";
            treeNode9.Text = "Node2";
            treeNode10.Name = "Node11";
            treeNode10.Text = "Node11";
            treeNode11.Name = "Node12";
            treeNode11.Text = "Node12";
            treeNode12.Name = "Node14";
            treeNode12.Text = "Node14";
            treeNode13.Name = "Node19";
            treeNode13.Text = "Node19";
            treeNode14.Name = "Node20";
            treeNode14.Text = "Node20";
            treeNode15.Name = "Node17";
            treeNode15.Text = "Node17";
            treeNode16.Name = "Node18";
            treeNode16.Text = "Node18";
            treeNode17.Name = "Node15";
            treeNode17.Text = "Node15";
            treeNode18.Name = "Node16";
            treeNode18.Text = "Node16";
            treeNode19.Name = "Node13";
            treeNode19.Text = "Node13";
            treeNode20.Name = "Node3";
            treeNode20.Text = "Node3";
//.........这里部分代码省略.........
开发者ID:Behzadkhosravifar,项目名称:AdvTreeView,代码行数:101,代码来源:TestForm.cs


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