在c#中createtree如何创建和应用?
来源:百度知道 编辑:UC知道 时间:2024/05/18 14:24:58
建window窗体文件命名为:Demo_7
在窗体里建五个按钮,一个treeView,不改名
复制下列代码,运行
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Demo_7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
treeView1.ExpandAll();
}
private void button2_Click(object sender, EventArgs e)
{
treeView1.CollapseAll();
}
private void button3_Click(object sender, EventArgs e)
{
treeView1.SelectedNode.Nodes.Add("New Nodes");
}
private void button4_Click(object sender, EventArg