我目前正在向树形视图中的父节点添加各种值,但我无法找出如何添加到树下特定的节点,目前它只是添加到“选定节点”。
using (var reader = File.OpenText("Configuration.ini"))
{
List<string> hostnames = ParseExternalHosts(reader).ToList();
foreach (string s in hostnames)
{
TreeNode newNode = new TreeNode(s);
hostView.SelectedNode.Nodes.Add(newNode);
}