Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1") Dim nd As WinForm.TreeNode = tr.SelectedNode If nd IsNot Nothing Then If nd.Level = 0 Then DataTables("产品").DeleteFor("ID = '" & nd.text & "'") ElseIf nd.Level = 1 Then DataTables("产品").DeleteFor("ID = '" & nd.ParentNode.text & "' And 名称 = '" & nd.Text & "'") End If nd.Delete End If tr.Select