Foxtable(狐表)用户栏目专家坐堂 → [求助]TreeView全选和反选


  共有2780人关注过本帖树形打印复制链接

主题:[求助]TreeView全选和反选

帅哥哟,离线,有人找我吗?
y2287958
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:4752 积分:34568 威望:0 精华:0 注册:2008/8/31 22:44:00
  发帖心情 Post By:2020/1/27 9:08:00 [显示全部帖子]

全选
Dim trv As WinForm.TreeView = Forms("窗口1").Controls("TreeView1")
For Each nd As WinForm.TreeNode In trv.AllNodes
    nd.Checked = True
Next

---------------------------------------------------------------------
反选
Dim trv As WinForm.TreeView = Forms("窗口1").Controls("TreeView1")
For Each nd As WinForm.TreeNode In trv.AllNodes
    nd.Checked = not nd.Checked
Next

 回到顶部