以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]节点不选定  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=79049)

--  作者:blsu33
--  发布时间:2015/12/23 12:53:00
--  [求助]节点不选定
老师,
  

For Each bt As object In Forms("通用目录树").Controls
                If  Typeof bt Is WinForm.TreeView  Then \'判断控件是否是目录树
                    Dim trv As WinForm.TreeView = Forms("通用目录树").Controls(bt.name)
                    If drp.Text > "" Then \'如果内容不为空
                        For Each nd As WinForm.TreeNode In trv.AllNodes
                            If nd.Text.IndexOf(drp.Text) >= 0 Then
                                trv.StopRedraw()
                                trv.SelectedNode = nd
                                nd.EnsureVisible()
                                trv.ResumeRedraw()
                                Exit For
else
trv.SelectedNode = nothing     这块怎么写
                            End If
                        Next
                    End If
                End If
            Next


--  作者:大红袍
--  发布时间:2015/12/23 14:28:00
--  

目录树肯定有一个选定节点。你可以选定一个空节点或者没有意义的节点。