Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim pd As WinForm.TreeNode = trv.SelectedNode
If pd.Level = 2 Then
pd = pd.ParentNode
End If
Dim i As Integer
Do
i = i+ 1
Dim nm As String = "权限" & i
If pd.Nodes.Contains(nm) = False
Dim nd As WinForm.TreeNode = pd.Nodes.Add(nm)
Dim dr As DataRow = DataTables("菜单目录").AddNew()
dr("子菜单") = pd.name
dr("权限") = nm
trv.SelectedNode = nd
trv.BeginEdit
Exit Do
End If
Loop
此主题相关图片如下:企业微信截图_20200526074304.png