以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 想分科目类别单独选择 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=194857) |
|
-- 作者:zhuxinhui -- 发布时间:2025/1/21 18:23:00 -- 想分科目类别单独选择 DataTables("会计科目").loadtop = Nothing DataTables("会计科目").loadfilter = "科目类型=\'损益\'" DataTables("会计科目").load() Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1") Dim rts() As String = {"损益"} Dim nd As WinForm.TreeNode Dim dt As DataTable = DataTables("会计科目") tr.StopRedraw() tr.Nodes.Clear Dim gz As String = "444" tr.Nodes.Add(rt) Next For Each dr As DataRow In dt.Select("", "科目编码") If dr.IsNull("科目编码") = False AndAlso dr("科目编码").Length = val(gz(0)) Then Dim i As Integer = CInt(dr("科目编码").Substring(0, 1)) nd = tr.Nodes(i).Nodes.Add(dr("科目编码"), dr("科目编码") & " " & dr("科目名称")) Functions.Execute("km", nd, dt, gz, 1) End If Next tr.ResumeRedraw()
|
|
-- 作者:有点蓝 -- 发布时间:2025/1/21 20:04:00 -- 没看懂什么意思 |
|
-- 作者:zhuxinhui -- 发布时间:2025/1/22 9:14:00 -- 删除目录树节点名称为:资产、负债、成本、损益,代码怎样写 |
|
-- 作者:zhuxinhui -- 发布时间:2025/1/22 9:26:00 -- 或者删除一、二级没有子节点的目录树节点 |
|
-- 作者:zhuxinhui -- 发布时间:2025/1/22 9:29:00 -- 我想使用下面的代码,先生成目录树,再删除一、二级没有节点的目录树节点。这样就可以做到我选择哪类科目就加载哪类 Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim rts() As String = {"全部", "资产"} Dim nd As WinForm.TreeNode Dim dt As DataTable = DataTables("会计科目") tr.StopRedraw() tr.Nodes.Clear Dim gz As String = "444" For Each rt As String In rts tr.Nodes.Add(rt) Next For Each dr As DataRow In dt.Select("", "科目编码") If dr.IsNull("科目编码") = False AndAlso dr("科目编码").Length = val(gz(0)) Then Dim i As Integer = CInt(dr("科目编码").Substring(0, 1)) nd = tr.Nodes(i).Nodes.Add(dr("科目编码"), dr("科目编码") & " " & dr("科目名称")) Functions.Execute("km", nd, dt, gz, 1) End If Next tr.ResumeRedraw() |
|
-- 作者:有点蓝 -- 发布时间:2025/1/22 10:09:00 -- 放到最后 for i as integer = tr.Nodes.count - 1 if tr.Nodes(i).nodes.count = 0 then tr.Nodes(i).delete next
|
|
-- 作者:zhuxinhui -- 发布时间:2025/1/22 11:18:00 -- 语法错误 此主题相关图片如下:微信截图_20250122111605.png |
|
-- 作者:zhuxinhui -- 发布时间:2025/1/22 11:26:00 -- DataTables("会计科目").loadtop = Nothing DataTables("会计科目").loadfilter = "科目类型=\'资产\'" DataTables("会计科目").load() Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1") Dim rts() As String = {"全部", "资产"} Dim nd As WinForm.TreeNode Dim dt As DataTable = DataTables("会计科目") tr.StopRedraw() tr.Nodes.Clear Dim gz As String = "444" For Each rt As String In rts tr.Nodes.Add(rt) Next For Each dr As DataRow In dt.Select("", "科目编码") If dr.IsNull("科目编码") = False AndAlso dr("科目编码").Length = val(gz(0)) Then Dim i As Integer = CInt(dr("科目编码").Substring(0, 1)) nd = tr.Nodes(i).Nodes.Add(dr("科目编码"), dr("科目编码") & " " & dr("科目名称")) Functions.Execute("km", nd, dt, gz, 1) End If Next tr.ResumeRedraw()
|
|
-- 作者:有点蓝 -- 发布时间:2025/1/22 11:27:00 -- 很简单的错误,自己思考一下:http://www.foxtable.com/webhelp/topics/0225.htm |
|
-- 作者:zhuxinhui -- 发布时间:2025/1/22 15:51:00 -- for i as integer = 0 TO tr.Nodes.count - 1 if tr.Nodes(i).nodes.count = 0 then tr.Nodes(i).delete
|