K So I got the code worked out for what it needs to be but vb seems to be complaining about it.
is there a way to set a variable inside of a key_up event heres my code:
So it appears to be working now even though I didnt change anything. Anyone know what Might have cause this? and now its broken again ***?.... Just noticed I was removing the node and then trying to do stuff with it. ROFL my badCode:Private Sub TreeView1_KeyUp(KeyCode As Integer, Shift As Integer) Debug.Print TreeView1.SelectedItem.Key Debug.Print KeyCode If KeyCode = 46 Then 'remove node from tree as well as remove it from the array using replace TreeView1.Nodes.Remove (TreeView1.SelectedItem.Index) TextOutPut(Val(TreeView1.SelectedItem.Parent.Key)) = Replace(TextOutPut(Val(TreeView1.SelectedItem.Parent.Key)), TreeView1.SelectedItem.Key & vbCrLf, "") ' Heres the line it keeps complaining about End If End Sub
I still need help though... How Can I remove the Parent Node When it has no more children? I dont know how to set a variable to a specific node basically I wanna put
a = treeview.selecteditem.node
if a.children = 0 remove a
Anyone got any ideas on how to do this?... Nevermind figured it out again (I was really close just wasnt removing the correct node...)


Reply With Quote