Foxtable(狐表)用户栏目专家坐堂 → 用目录树样式添加好友,怎么让本人用户名不显示在树种


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

主题:用目录树样式添加好友,怎么让本人用户名不显示在树种

美女呀,离线,留言给我吧!
yfy13338431925
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:512 积分:4492 威望:0 精华:0 注册:2018/12/5 23:10:00
用目录树样式添加好友,怎么让本人用户名不显示在树种  发帖心情 Post By:2021/4/21 12:39:00 [显示全部帖子]


图片点击可在新窗口打开查看此主题相关图片如下:图片2.png
图片点击可在新窗口打开查看

通过这张表,建立下面的目录树

图片点击可在新窗口打开查看此主题相关图片如下:图片1.png
图片点击可在新窗口打开查看

Dim r As Row = Tables("表A").Current
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
e.Form.Controls("Label1").Text =  user.name & "的好友"
trv.BuildTree("表A","角色|姓名")
trv.ExpandAll
Dim Buddies() As String = r("好友").Split(",")
For Each Buddy As String In Buddies
    Dim pts() As String = Buddy.Split(".")
    If trv.Nodes.Contains(pts(0)) Then
        If trv.Nodes(pts(0)).Nodes.Contains(pts(1)) Then
            trv.Nodes(pts(0)).Nodes(pts(1)).Checked = True
        End If
    End If 
Next
改这段码,让用户本人不显示在树中

确定后,则自动选择在表A本人用户的好友列添加好友,下面的代码好像完成不了
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim nms As String
For Each nd As WinForm.TreeNode In trv.AllNodes
    If nd.Checked AndAlso  nd.Level = 1 Then
        nms = nms & "," & nd.FullName.Replace("\",".")
    End If
Next
If nms > "" Then
    Tables("表A").Current("好友") = nms.Trim(",")
End If
e.Form.Close()


[此贴子已经被作者于2021/4/21 12:40:47编辑过]

 回到顶部