I am really struggling to understand how to do this.
I have Form1 that has a treeView1. On Form1, I select a Node that I want to add a ChildNode to and then click Button1.
Button1 (on Form1) will open Form2 which contains a Listview1 with checkboxes.
I will then either...
Check items on the Listview1 that I want to add to the Node that I had selected on Form1 (could be 1 item checked or multiple) then click buttonAdd. The buttonAdd would return to form1 and add the selected items to treeview1 previously selected Node.
OR
I could also click buttonCancel (on form2) and select nothing and return to Form1.
I am really grasping to understand the treeview.
Can someone please assist me with this.
I have Form1 that has a treeView1. On Form1, I select a Node that I want to add a ChildNode to and then click Button1.
Button1 (on Form1) will open Form2 which contains a Listview1 with checkboxes.
I will then either...
Check items on the Listview1 that I want to add to the Node that I had selected on Form1 (could be 1 item checked or multiple) then click buttonAdd. The buttonAdd would return to form1 and add the selected items to treeview1 previously selected Node.
OR
I could also click buttonCancel (on form2) and select nothing and return to Form1.
I am really grasping to understand the treeview.
Can someone please assist me with this.
VBA Code:
Private Sub buttonAdd_Click()
Form2.show
'This gives me an error Invalid Key'
Me.TreeView1.Nodes.Add Me.TreeView1.SelectedItem.Text, tvwChild, Form2.listview1.SelectedItem.Text, Form2.listview1.SelectedItem.Text
'This gives me an error Invalid Key'
Me.TreeView1.Nodes.Add Me.TreeView1.SelectedItem.Index, tvwChild, Form2.listview1.SelectedItem.Checked, Form2.listview1.SelectedItem.Text
'This gives me an error Index Out of Bounds'
Me.TreeView1.Nodes.Add Me.TreeView1.SelectedItem.Selected, tvwChild, Form2.listview1.SelectedItem.Checked, Form2.listview1.SelectedItem.Text
End Sub