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
详细错误信息:
语法错误:“=”运算符后缺少操作数。