一、 这是根据帮助里面做的级码式目录树.
代码很简单:
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.GenerateTree("表a","级码","单位", ".")
此主题相关图片如下:qq截图20130606145032.png
二、想改造以下代码(也是帮助里面的范本),实现可筛选的多值目录树,即选目录树里面哪一级公司,就筛选出相应的公司
求大大出手示意!
——————————————————————这是帮助里面的范本——————————————————
3、将目录树的AfterCheckNode事件代码设置为:
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String
For Each nd As WinForm.TreeNode In e.node.Nodes '清除子节点选中状态
nd.Checked = False
Next
If e.node.ParentNode IsNot Nothing Then '去掉父节点选中状态
e.node.ParentNode.Checked = False
End If
For Each nd As WinForm.TreeNode In trv.AllNodes
If nd.Checked Then
If flt > "" Then
flt = flt & " Or " '注意用or而不是And
End If
If nd.Level = 0 Then '注意下面的条件都要用括号括起来
flt = flt & "( 产品 = '" & nd.Text & "')"
Else
flt = flt & "( 产品 = '" & nd.ParentNode.Text & "' And 客户 = '" & nd.Text & "')"
End If
End If
Next
Tables("订单").Filter = flt
[此贴子已经被作者于2013-6-7 8:26:57编辑过]