以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]能否只提取子目录字符  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=52839)

--  作者:倪惠明
--  发布时间:2014/6/24 9:07:00
--  [求助]能否只提取子目录字符

用目录树方式选择用户,为了方便选择部门则选择了该部门的所有用户,但在信息发送时不需要部门,只需要用户名,能否将部门给剔除。

Dim s As String
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
For Each nd As WinForm.TreeNode In trv.AllNodes
    If nd.Checked Then
        s = s & "," & nd.Text
    End If
Next
If s = "" Then
    e.Form.DropDownBox.Value = ""
Else
    e.Form.DropDownBox.Value = s.trim(",")
End If
e.Form.DropDownBox.CloseDropdown


--  作者:Bin
--  发布时间:2014/6/24 9:11:00
--  
请上例子,你的意思是取最后的末端节点名称吗?
--  作者:倪惠明
--  发布时间:2014/6/24 9:12:00
--  
是的。
--  作者:有点甜
--  发布时间:2014/6/24 9:21:00
--  
Dim s As String
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
For Each nd As WinForm.TreeNode In trv.AllNodes
    If nd.Checked AndAlso nd.Nodes.Count = 0 Then
        s = s & "," & nd.Text
    End If
Next
If s = "" Then
    e.Form.DropDownBox.Value = ""
Else
    e.Form.DropDownBox.Value = s.trim(",")
End If
e.Form.DropDownBox.CloseDropdown

--  作者:倪惠明
--  发布时间:2014/6/24 9:29:00
--  
非常感谢!