CodePudding user response:
Is that what your treeview? If it's just to see, cover it with a picture, did not respond to any event,CodePudding user response:
Don't know the hooks its message processing can do,CodePudding user response:
Treeview expand and Collapse events to handleFor example
Private Sub Command1_Click ()
T1. Nodes. The Add, "n1" and "node1
"T1. Nodes. The Add "n1", tvwChild, "n1-1", "node1-1
"T1. Nodes. The Add, "n2", "2",
T1. Nodes. The Add "n2", tvwChild, "n2-1", "2-1
"End Sub
Private Sub t1_Collapse (ByVal Node As MSComctlLib. Node)
If the Node. The Key="n2" Then
Node. Expanded=Not (Node. Expanded)
End the If
End Sub
Private Sub t1_Expand (ByVal Node As MSComctlLib. Node)
If the Node. The Key="n1" Then
Node. Expanded=Not (Node. Expanded)
End the If
End Sub
Node1 and 2 children
Node1 does not allow, 2 are not allowed to shrink