Foxtable(狐表)用户栏目专家坐堂 → 未找到类型“ToggleButton”的公共成员“items”


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

主题:未找到类型“ToggleButton”的公共成员“items”

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


加好友 发短信
等级:小狐 帖子:357 积分:2568 威望:0 精华:0 注册:2020/7/24 10:30:00
未找到类型“ToggleButton”的公共成员“items”  发帖心情 Post By:2022/7/12 16:26:00 [只看该作者]

老师:
      这个窗口报错麻烦帮忙分析一下。
错误所在事件:窗口,菜单权限,AfterLoad
详细错误信息:
未找到类型“ToggleButton”的公共成员“items”。



Dim trv1 As WinForm.TreeView = e.Form.Controls("用户列表")
For Each u As UserInfo In Users
    If u.Type = UserTypeEnum.User Then '排除管理员和开发者
        If trv1.Nodes.Contains(u.Group) = False Then
            trv1.Nodes.Add(u.Group)
        End If
        trv1.Nodes(u.Group).Nodes.Add(u.Name)
     End If
Next
Dim tv As WinForm.TreeView = e.Form.Controls("菜单权限")
tv.Nodes.Clear
tv.Nodes.Add("功能区")
For Each rtb As RibbonMenu.Tab In RibbonTabs
    If tv.Nodes("功能区").Nodes.Contains(rtb.Name) = False
        tv.Nodes("功能区").Nodes.Add(rtb.Name)
    End If
    For Each grp As RibbonMenu.Group In rtb.Groups
        If tv.Nodes("功能区").Nodes(rtb.Name).Nodes.Contains(grp.Name) = False Then
            tv.Nodes("功能区").Nodes(rtb.Name).Nodes.Add(grp.Name)
        End If
        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 = "请选择用户!!!"

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


加好友 发短信
等级:超级版主 帖子:107014 积分:544295 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/7/12 16:29:00 [只看该作者]

提示很明显了,ToggleButton菜单没有items属性,加上判断 ,如果是ToggleButton就不要取items了

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


加好友 发短信
等级:小狐 帖子:357 积分:2568 威望:0 精华:0 注册:2020/7/24 10:30:00
回复:(有点蓝)提示很明显了,ToggleButton菜单没有...  发帖心情 Post By:2022/7/12 17:29:00 [只看该作者]


这样写吗?

If 菜单权限.GetType.Name Like "*ToggleButton*" Then  。。。



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


加好友 发短信
等级:超级版主 帖子:107014 积分:544295 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/7/12 17:36:00 [只看该作者]

和这种判断一样

 If itm9.Gettype.name <> "Button"   Then 

 回到顶部