當我想補充父節點,第一個我添加的作品, Parent Node 1 但是當我想要添加另一名家長髮生這種情況相同的特性: Parent Node 2林有問題添加多個父節點的樹狀視圖
繼承人我的代碼:
公共無效的add(){
TreeView t = new TreeView();
t = treeView1;
names.Add(textBox1.Text);
passwords.Add(textBox2.Text);
emails.Add(textBox3.Text);
websites.Add(textBox4.Text);
string addedname = textBox1.Text;
string addedpass = textBox2.Text;
string addedemail = textBox3.Text;
string addedwebsite = textBox4.Text;
string nodename = textBox5.Text;
int treecount = 0;
removewhat = nodename;
t.Nodes.Add(nodename);
t.Nodes[treecount].Nodes.Add($"Username: {addedname?? "Empty"}");
t.Nodes[treecount].Nodes.Add($"Password: {addedpass?? "Empty"}");
t.Nodes[treecount].Nodes.Add($"Email: {addedemail?? "Empty"}");
t.Nodes[treecount].Nodes.Add($"Website: {addedwebsite ?? "Empty"}");
treecount += 1;
removewhat = null;
nodename = null;
addedname = null;
addedpass = null;
addedemail = null;
addedwebsite = null;
textBox3.Clear();
textBox4.Clear();
textBox1.Clear();
textBox2.Clear();
textBox5.Clear();
}