通用代码,哪种目录树都适用:
NodeMouseDoubleClick
e.Sender.StopRedrawFor Each nd As WinForm.TreeNode In e.Sender.AllNodes If nd.Name <> e.Node.Name AndAlso e.Node.Nodes.Count > 0 Then nd.Collapse End If e.Node.EnsureVisible e.Sender.SelectedNode = e.NodeNexte.Sender.ResumeRedraw