Foxtable(狐表)用户栏目专家坐堂 → 这段代码有错误


  共有1875人关注过本帖树形打印复制链接

主题:这段代码有错误

帅哥哟,离线,有人找我吗?
天蝉一线
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:370 积分:3195 威望:0 精华:0 注册:2016/6/16 16:11:00
这段代码有错误  发帖心情 Post By:2016/7/30 17:20:00 [只看该作者]

Dim trv1 As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView2")
Dim nd1 As WinForm.TreeNode = trv1.SelectedNode
Dim dr As DataRow
If e.Node.ParentNode IsNot Nothing Then '取消父节点的选中标记,因为选中子节点,就不要选中父节点了
    e.Node.ParentNode.Checked = False
End If
For Each cnd As WinForm.TreeNode In e.Node.Nodes '取消子节点的选中标记,因为选中父节点,就不要选中子节点了
    cnd.Checked = False
Next
If nd1.Level = 0 Then
    dr = DataTables("授权").Find("功能模块 = '" & nd1.Name & "' And 窗口菜单 Is Null")
Else
    dr = DataTables("授权").Find("功能模块 = '" & nd1.ParentNode.Name & "' And 窗口菜单 = '" & nd1.Name & "'")
End If
If dr IsNot Nothing Then
    Dim nms As String
    For Each nd2 As WinForm.TreeNode In trv2.AllNodes
        If nd2.Checked  Then
            nms  = nd2.Name
        End If
    Next
    If nms > "" Then
        dr("用户角色") = nms
    Else
        dr("用户角色") = Nothing
    End If
End If

错误提示:.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2016.6.21.1
错误所在事件:窗口,权限管理,TreeView2,AfterCheckNode
详细错误信息:
未将对象引用设置到对象的实例。


 回到顶部
帅哥哟,离线,有人找我吗?
Hyphen
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/7/30 17:39:00 [只看该作者]

Dim nd1 As WinForm.TreeNode = trv1.SelectedNode
if nd1 is nothing then return

 回到顶部