Foxtable(狐表)用户栏目专家坐堂 → 求助 如何禁止编辑


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

主题:求助 如何禁止编辑

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/3/2 9:26:00 [显示全部帖子]

参考代码

 

Dim tab3 As WinForm.TabControl = e.form.controls("TabControl1")
For Each c As object In tab3.TabPages(1).children
    c.enabled = False
Next

 

改进代码

 

Dim tab3 As WinForm.TabControl = e.form.controls("TabControl1")
For Each c As object In tab3.TabPages(1).children
    If typeof c Is winform.Table Then
        c.Table.allowEdit = False
    Else
        c.enabled = False
    End If
Next


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/3/2 10:35:00 [显示全部帖子]

Dim tab3 As WinForm.TabControl = e.form.controls("TabControl1")
If User.IsRole("出货记录模块") Then
    For Each c As object In tab3.TabPages("出货记录").children
        If typeof c Is winform.Table Then
            c.Table.allowEdit = False
        Else
            c.enabled = False
        End If
    Next
Else
    For Each c As object In tab3.TabPages("出货记录").children
        If typeof c Is winform.Table Then
            c.Table.allowEdit = True
        Else
            c.enabled = True
        End If
    Next
End If


 回到顶部