以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 未找到类型“ToggleButton”的公共成员“items” (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=178624) |
-- 作者:wukangppbb -- 发布时间:2022/7/12 16:26:00 -- 未找到类型“ToggleButton”的公共成员“items” 老师: 这个窗口报错麻烦帮忙分析一下。 错误所在事件:窗口,菜单权限,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 = "请选择用户!!!" |
-- 作者:有点蓝 -- 发布时间:2022/7/12 16:29:00 -- 提示很明显了,ToggleButton菜单没有items属性,加上判断 ,如果是ToggleButton就不要取items了 |
-- 作者:wukangppbb -- 发布时间:2022/7/12 17:29:00 -- 回复:(有点蓝)提示很明显了,ToggleButton菜单没有... 这样写吗? If 菜单权限.GetType.Name Like "*ToggleButton*" Then 。。。 |
-- 作者:有点蓝 -- 发布时间:2022/7/12 17:36:00 -- 和这种判断一样 If itm9.Gettype.name <> "Button" Then
|