-- 作者:today_ok
-- 发布时间:2012/4/28 8:25:00
-- 目录树图标设定求解
以下是一段窗口加载语句
Dim tv As WinForm.TreeView tv =e.Form.Controls("TreeView1") tv.BuildTree("vw_stocktree", "a0|a1|a2|a3|a4|a5")
Dim ndname As String \'节点名称 Dim stockfnumber As String \'仓库代码 Dim dt As DataTable = DataTables("vw_stock") \'仓库表 Dim dr As DataRow \'数据行 Dim a As String
For Each nd As WinForm.TreeNode In tv.AllNodes ndname=nd.text If ndname="仓库" Then nd.Ic Else stockfnumber = ndname.SubString(1, ndname.IndexOf("(")-1 ) \'取仓库代码出来 a="fnumber= \'"& stockfnumber & "\' And fdetail=True" dr = dt.Find(a) \'看仓库代码在表里是否有最明细的记录 \'a=dr("fnumber") If dr IsNot Nothing Then nd.Ic \'如果有则一种图标 Else nd.Ic \' 否则另一种图标
End If End If Next
大家帮我看一下这段代码,我的目录树总不执行 nd.Ic \'如果有则一种图标 这一段,是我的dr没有记录吗?
我的查找语句那样写对吗?
|