代码生成的下拉二级菜单怎么只显示一个菜单,其它分页了,怎样用代码显示全部
此主题相关图片如下:微信图片_20200512182020.jpg
递归函数:
Dim mnu As object = args(0)
Dim cs As DataTable = args(1)
Dim mc As String = args(2)
For Each dr As DataRow In cs.Select("id = 'lr_001' And 上级名称 = '" & mc & "'","顺序")
If dr IsNot Nothing Then
Dim itm As WinForm.StripItem
itm = mnu.Items(dr("名称"))
If dr("控件类型") = "菜单" Then
mnu.Items.Add(dr("名称"),dr("标题文本"),dr("图标") ,StripItemTypeEnum.MenuItem)
End If
If dr("控件类型") = "按钮" Then
mnu.Items.Add(dr("名称"),dr("标题文本"),dr("图标") ,StripItemTypeEnum.Button )
End If
If dr("控件类型") = "组合按键" Then
mnu.Items.Add(dr("名称"),dr("标题文本"),dr("图标"),StripItemTypeEnum.SplitButton)
End If
If dr("控件类型") = "分割条" Then
mnu.Items.Add(dr("名称"),dr("标题文本"),dr("图标"),StripItemTypeEnum.Separator)
End If
If dr("控件类型") = "标签" Then
mnu.Items.Add(dr("名称"),dr("标题文本"),dr("图标"),StripItemTypeEnum.Label)
End If
Functions.Execute("生成子控件",itm,cs,dr("名称"))
End If
For Each sit As WinForm.StripItem In mnu.Items
sit.DisplayText = True
sit.TextPosition =TextPositionEnum.Right
Next
Next
[此贴子已经被作者于2020/5/12 18:27:50编辑过]