以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 用目录树样式添加好友,怎么让本人用户名不显示在树种 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=163030) |
||||||||||
-- 作者:yfy13338431925 -- 发布时间:2021/4/21 12:39:00 -- 用目录树样式添加好友,怎么让本人用户名不显示在树种 此主题相关图片如下:图片2.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编辑过]
|
||||||||||
-- 作者:有点蓝 -- 发布时间:2021/4/21 13:33:00 -- 语法: BuildTree(DataTableName, Columns, Filter, Sort) 或 BuildTree(DataTable, Columns, Filter, Sort)
|
||||||||||
-- 作者:有点蓝 -- 发布时间:2021/4/21 13:34:00 -- nms = nms & "," & nd.text |