发布网友 发布时间:2024-10-24 07:02
共1个回答
热心网友 时间:2024-10-24 08:51
TreeNode gen = new TreeNode();//根节点
gen.Text = "xxx";
gen.Value = "xxx";
TreeView1.Nodes.Add(gen);
TreeNode sec = new TreeNode();//子节点,可以循环
sec.Text = "xxx";
sec.Value = "xxx";
gen.ChildNodes.Add(sec);