Foxtable(狐表)用户栏目专家坐堂 → 动态生成菜单代码执行的问题


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

主题:动态生成菜单代码执行的问题

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


加好友 发短信
等级:管理员 帖子:47477 积分:251256 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/8/19 17:37:00 [显示全部帖子]

Dim code As String
For Each dr As DataRow In DataTables("表A").DataRows
        If dr("功能区") = 菜单 And dr("菜单组件名称") = 按钮 Then
            code = dr("代码") & vbcrlf
            code = code & "Return Nothing"
            Functions.add("zhi",code)
            Functions.complie()
            Functions.Execute("zhi")
            Return
        End If
Next
Functions.remove("zhi")

Dim code1 As String
For Each dr As DataRow In DataTables("表C").DataRows
    Dim itm As RibbonMenu.RibbonItem
    For Each itm In QAT.Items
        If itm.Name =(dr("访问栏组件名称")) Then
            code1 = dr("代码编辑器") & vbcrlf
            code1 = code1 & "Return Nothing"
            Functions.Add("dtsc",code1)
            Functions.Complie()
            Functions.Execute("dtsc")
            Functions.remove("dtsc")
            Return
        End If
    Next
Next
Functions.remove("dtsc")

Dim code2 As String
For Each dr2 As DataRow In DataTables("配置栏").DataRows
    Dim item As RibbonMenu.RibbonItem
    For Each item In ConfigBar.Items
        If item.Name =(dr2("配置栏组件名称")) Then
            code2 = dr2("代码编辑器") & vbcrlf
            code2 = code2 & "Return Nothing"
            Functions.Add("dtsc1",code2)
            Functions.Complie()
            Functions.Execute("dtsc1")
            Functions.remove("dtsc1")
            Return
        End If
    Next
Next
Functions.remove("dtsc1")


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


加好友 发短信
等级:管理员 帖子:47477 积分:251256 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/8/20 19:13:00 [显示全部帖子]

不是很明白你的问题,做个例子看看。

 回到顶部