例子中的《菜单权限》窗口点击应用时,显示《未将对象引用设置到对象的实例。》,错误所在位置代码如下,求帮助
For Each itm As RibbonMenu.RibbonItem In grp.Items
If tv.Nodes("功能区").Nodes(rtb.Name).Nodes(grp.Name).Nodes.Contains(itm.Name) = False Then
tv.Nodes("功能区").Nodes(rtb.Name).Nodes(grp.Name).Nodes.Add(itm.Name)
End If
Next
Next
Next
'快速访问兰
Dim tv9 As WinForm.TreeView = e.Form.Controls("菜单权限")
tv9.Nodes.Add("快速访问栏")
For Each itm9 As object In QAT.Items
Dim nd9 As object = tv9.Nodes("快速访问栏").Nodes.Add(itm9.Name)
If itm9.Gettype.name <> "Button" Then
If itm9.Gettype.name <> "Separator" Then
For Each citm As object In itm9.items
Dim cnd As object = nd9.Nodes.Add(citm.Name)
If citm.Gettype.name <> "Button" Then
If citm.Gettype.name <> "Separator" Then
For Each ccitm As RibbonMenu.RibbonItem In citm.items
Dim ccnd As object = cnd.Nodes.Add(ccitm.Name)
Next
End If
End If
Next
End If
End If
Next
'配置兰
tv9.Nodes.Add("配置栏")
For Each itm9 As object In ConfigBar.Items
Dim nd9 As object = tv9.Nodes("配置栏").Nodes.Add(itm9.Name)
If itm9.Gettype.name <> "Button" Then
If itm9.Gettype.name <> "Separator" Then
For Each citm As object In itm9.items
Dim cnd As object = nd9.Nodes.Add(citm.Name)
If citm.Gettype.name <> "Button" Then
If citm.Gettype.name <> "Separator" Then
For Each ccitm As RibbonMenu.RibbonItem In citm.items
Dim ccnd As object = cnd.Nodes.Add(ccitm.Name)
Next
End If
End If
Next
End If
End If
Next
Dim trv8 As WinForm.TreeView = e.Form.Controls("菜单权限")
For Each nd8 As WinForm.TreeNode In tv.AllNodes
If nd8.Text.IndexOf("分割条") >= 0 Then
nd8.Delete()
End If
Next
e.Form.Controls("菜单权限").Enabled = False
e.Form.Controls("Btn菜单授权保存").Enabled = False
e.Form.Controls("Btn菜单授权清除").Enabled = False
e.Form.Controls("Btn菜单授权编辑").Enabled = False
e.Form.Controls("提示1").Text = "请选择用户!!!"