以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 目录树语法错误问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=113148) |
-- 作者:benwong2013 -- 发布时间:2018/1/10 9:59:00 -- 目录树语法错误问题 如下: 在AfterSelectNode的代码: If e.Node.DataRow Is Nothing Then Tables("B_Room").Position = Tables("B_Room").FindRow("_Identify = " & e.Node.tag) Else Tables("B_Room").Position = Tables("B_Room").FindRow(e.node.DataRow) End If 在AfterEditNode的代码: If e.NewText = "" Then e.Cancel = True Return End If Dim pth() As String = e.Node.FullPath.Split("\\") Select Case e.node.Level Case 0 DataTables("B_Room").ReplaceFor("仓库一级",e.NewText,"仓库一级 = \'" & pth(0) & "\'") Case 1 DataTables("B_Room").ReplaceFor("仓库二级",e.NewText,"仓库一级 = \'" & pth(0) & "\' And 仓库二级 = \'" & pth(1) & "\'") Case 2 DataTables("B_Room").ReplaceFor("仓库三级",e.NewText,"仓库一级 = \'" & pth(0) & "\' And 仓库二级 = \'" & pth(1) & "\' And 仓库三级 = \'" & pth(2) & "\'") Case 3 DataTables("B_Room").ReplaceFor("仓库四级",e.NewText,"仓库一级 = \'" & pth(0) & "\' And 仓库二级 = \'" & pth(1) & "\' And 仓库三级 = \'" & pth(2) & "\' And 仓库四级 = \'" & pth(3) & "\'") Case 4 DataTables("B_Room").ReplaceFor("仓库伍级",e.NewText,"仓库一级 = \'" & pth(0) & "\' And 仓库二级 = \'" & pth(1) & "\' And 仓库三级 = \'" & pth(2) & "\' And 仓库四级 = \'" & pth(3) & "\' And 仓库伍级 = \'" & pth(4) & "\'") Case 5 DataTables("B_Room").ReplaceFor("仓库六级",e.NewText,"仓库一级 = \'" & pth(0) & "\' And 仓库二级 = \'" & pth(1) & "\' And 仓库三级 = \'" & pth(2) & "\' And 仓库四级 = \'" & pth(3) & "\' And 仓库伍级 = \'" & pth(4) & "\' And 仓库六级 = \'" & pth(5) & "\'") End Select e.Node.Name = e.NewText 在窗体按钮增加仓库的代码如下: Dim dr As DataRow = DataTables("B_Room").AddNew dr("仓库一级") = "新节点" Dim tr As WinForm.TreeView Dim nd As WinForm.TreeNode tr = e.Form.Controls("TreeView1") nd = tr.Nodes.Add("新节点") tr.SelectedNode = nd tr.Select() tr.BeginEdit() 当在点击增加的时候会出现以下的问题,请问是什么问题? .NET Framework 版本:2.0.50727.8669 Foxtable 版本:2017.12.18.1 错误所在事件:窗口,仓库管理,TreeView1,AfterSelectNode 详细错误信息: 语法错误:“=”运算符后缺少操作数。 |
-- 作者:有点甜 -- 发布时间:2018/1/10 10:09:00 -- Dim dr As DataRow = DataTables("B_Room").AddNew
dr("仓库一级") = "新节点"
Dim tr As WinForm.TreeView
Dim nd As WinForm.TreeNode
tr = e.Form.Controls("TreeView1")
nd = tr.Nodes.Add("新节点")
nd.Tag = dr("_Identify")
tr.SelectedNode = nd
tr.Select()
tr.BeginEdit()
|