勾选这样写。
Dim trv1 As WinForm.TreeView = e.Form.Controls("菜单")
Dim trv2 As WinForm.TreeView = e.Form.Controls("分组")
Dim cr As Row = Tables("授权").current
Dim nms As New List(of String)
If cr IsNot Nothing AndAlso cr.IsNull("菜单名") = False
nms.AddRange(cr("菜单名").Split(","))
End If
For Each nd As WinForm.TreeNode In trv1.AllNodes
nd.Checked = nms.Contains(nd.Name)
Next
nms.Clear
If cr IsNot Nothing AndAlso cr.IsNull("分组") = False
nms.AddRange(cr("分组").Split(","))
End If
For Each nd As WinForm.TreeNode In trv2.AllNodes
If nd.Level = 0 Then
nd.Checked = nms.Contains(nd.Name.split("-")(1))
End If
Next
nms.Clear
If cr IsNot Nothing AndAlso cr.IsNull("权限") = False
nms.AddRange(cr("权限").Split(","))
End If
For Each nd As WinForm.TreeNode In trv2.AllNodes
If nd.Level = 1 Then
nd.Checked = nms.Contains(nd.Name.split("-")(1))
End If
Next