Dim tab3 As WinForm.TabControl = e.form.controls("TabControl1")
If User.IsRole("出货记录模块") Then
tab3.TabPages("出货记录").Visible = False
Else
tab3.TabPages("出货记录").Visible = True
End If
-- 作者:有点甜
-- 发布时间: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
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