Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共7 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:不用页面集合的目录树 【wqc360请看】

1楼
mr725 发表于:2010/1/8 20:29:00
原问题在:http://www.datasoft.com.cn/fox/dispbbs.asp?boardid=2&Id=5711&page=2  的5楼中。

我做了个不用页面集合、也不用导航栏、也不用增加辅助表的,请看可以吗?
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:目录树 请引入到订单表的新窗口中.rar

2楼
wqc360 发表于:2010/1/8 21:00:00
谢谢mr725,我要的就是这个效果,是个这么久,您还记得,并帮我解决了,再次感谢
3楼
mr725 发表于:2010/1/8 21:41:00

俺把代码贴出来吧:

Dim dl as string = "产品|客户|雇员"
Dim tr As WinForm.TreeView
Dim nd,nd1,nd2,nd3 As WinForm.TreeNode
tr = e.Form.Controls("TreeView1")    'Forms("窗口1").Controls("TreeView1")   
tr.Nodes.Clear
for i as integer = 0 to dl.split("|").length-1
    nd = Tr.Nodes.Add("Root & i","按" & "" & dl.split("|")(i) & "")
    Dim pcas As List(Of String)
    pcas = DataTables("订单").GetUniqueValues("", "" & dl.split("|")(i) & "")
    For ii As integer = 0 to pcas.count-1
        nd1 = nd.Nodes.Add("Sub & ii+1","" & pcas(ii) & "")
        if i+1<=dl.split("|").length-1
            dim f as string = "[" & dl.split("|")(i) & "] = '" & nd1.text & "' "
            Dim cas As List(Of String) = DataTables("订单").GetUniqueValues( f ,"" & dl.split("|")(i+1) & "")
            for iii as integer = 0 to cas.count-1
                nd2 = nd1.Nodes.Add("Sub & iii+1","" & cas(iii) & "")
                if i+2=dl.split("|").length-1
                    dim f1 as string = "[" & dl.split("|")(i+1) & "] = '" & nd2.text & "'"
                    Dim ca As List(Of String) = DataTables("订单").GetUniqueValues(f & "and " & f1 ,"" & dl.split("|")(i+2) & "")
                    for iiii as integer = 0 to ca.count-1
                        nd3 = nd2.Nodes.Add("Sub & iiii+1","" & ca(iiii) & "")
                    next
                end if
                if i+2-dl.split("|").length+1 = 1
                    dim f1 as string = "[" & dl.split("|")(i+1) & "] = '" & nd2.text & "'"
                    Dim ca As List(Of String) = DataTables("订单").GetUniqueValues(f & "and " & f1 ,"" & dl.split("|")(0) & "")
                    for iiii as integer = 0 to ca.count-1
                        nd3 = nd2.Nodes.Add("Sub & iiii+1","" & ca(iiii) & "")
                    next
                end if
            next
        else
            dim f as string = "[" & dl.split("|")(i) & "] = '" & nd1.text & "' "
            Dim cas As List(Of String) = DataTables("订单").GetUniqueValues(f ,"" & dl.split("|")(0) & "")
            for iii as integer = 0 to cas.count-1
                nd2 = nd1.Nodes.Add("Sub & iii+1","" & cas(iii) & "")
                dim f1 as string = "[" & dl.split("|")(0) & "] = '" & nd2.text & "'"
                if i+2-dl.split("|").length-1 = 0
                    Dim ca As List(Of String) = DataTables("订单").GetUniqueValues(f & "and " & f1 ,"" & dl.split("|")(1) & "")
                    for iiii as integer = 0 to ca.count-1
                        nd3 = nd2.Nodes.Add("Sub & iiii+1","" & ca(iiii) & "")
                    next
                end if
            next
        end if
    Next
next


总觉得很繁琐应该可以简化的可是俺功底不足看看其他前辈和狐友的了

4楼
yangming 发表于:2010/1/9 11:45:00
收藏研究一下,先谢过mr725老师了!
5楼
xl 发表于:2010/1/9 14:56:00
收藏,谢谢mr725老师!
6楼
czy 发表于:2010/1/9 19:36:00
以下是引用mr725在2010-1-8 21:41:00的发言:

俺把代码贴出来吧:


总觉得很繁琐应该可以简化的可是俺功底不足看看其他前辈和狐友的了



厉害!

7楼
舜风 发表于:2010/1/9 21:02:00
收藏研究
共7 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03223 s, 3 queries.