以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  这个代码有啥问题?为啥只能生成一个功能组.  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=86534)

--  作者:blackzhu
--  发布时间:2016/6/20 9:34:00
--  这个代码有啥问题?为啥只能生成一个功能组.
Syscmd.Project.OpenUserMenu()
RibbonTabs.Clear
Dim Products As List(Of String)
Dim Customers As List(Of String)
Products = DataTables("功能导航").GetValues("功能区")
For Each Product As String In Products
    Dim gn As New RibbonMenu.Tab(Product)
    If  RibbonTabs.Contains(Product) Then
        Return Nothing
    Else
        gn.Text = Product
        RibbonTabs.Add(gn)
    End If
    Customers = DataTables("功能导航").GetValues("功能组","功能区 = \'" & Product & "\'")
    For Each Customer As String In Customers
        Output.Show(Customer)
        Dim g As New RibbonMenu.Group(Customer)
        g.Text = Customer
        RibbonTabs(Product).Groups.Add(g)
       Dim drs As List(Of DataRow) = DataTables("功能导航").Select("功能区 = \'" & Product & "\' And 功能组=\'" & Customer & "\'","序号")
        For Each dr As DataRow In drs
        Dim b As New RibbonMenu.Button(dr("模块名称"))
        b.Text = dr("模块标题")
        b.LargeImage = GetImage(ProjectPath & "Images\\" & dr("模块名称") & ".Ico")
        b.TextImageRelation = TextImageRelationEnum.ImageAboveText
        g.Items.Add(b)
        Next
    Next
Next
[此贴子已经被作者于2016/6/20 9:49:59编辑过]

--  作者:blackzhu
--  发布时间:2016/6/20 9:53:00
--  
我知道了 是隐藏了功能区的标题,我找了半天的原因.
--  作者:大红袍
--  发布时间:2016/6/20 9:54:00
--  
测试没问题,自己加入msgbox看循环了多少次。