TreeView treeView1=new TreeView (); //创建treeview实例
TreeViewItem item1 = new TreeViewItem(); //创建treeview子项实例
item1.Header = "123"; //设置文字内容
item1.Foreground = new SolidColorBrush(Colors.AliceBlue); //用固态画刷填充前景色
treeView1.Items.Add(item1); //集合中添加子项
望采纳