相关疑难解决方法(0)

将节点添加到 treeView (c#) 中的特定父节点

我目前正在向 treeView 中的父节点添加各种值,虽然我无法找到如何添加到树下的特定节点,但目前它只是添加到“选定节点”

 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);
                }
Run Code Online (Sandbox Code Playgroud)

.net c# windows

2
推荐指数
1
解决办法
9461
查看次数

标签 统计

.net ×1

c# ×1

windows ×1