TreeView 子节点有项被选中,展开父节点
TreeView 加载时 子节点有项被选中,展开父节点,求代码,多谢帮助。Private SubTreeView1_Initialize() Dim Node As Node For Each Node In TreeView1.Nodes ExpandParentIfChildSelected Node Next End Sub Private Sub ExpandParentIfChildSelected(Node As Node) Dim ChildNode As Node For Each ChildNode In Node.Children If ChildNode.Selected Then Node.Expanded = True ExpandParentIfChildSelected Node.Parent Exit For End If ExpandParentIfChildSelected ChildNode Next End Sub