以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  精简代码  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=70828)

--  作者:一笑
--  发布时间:2015/6/29 21:39:00
--  精简代码
能否否精简以下代码,谢谢
If _Username <> e.Form.Controls("TB_录入人").Value Then
e.Form.Controls("TB_内容").ReadOnly = BooleanEnum.True
e.Form.Controls("TB_过程备忘").ReadOnly = BooleanEnum.True
e.Form.Controls("cbb_开始时间").ReadOnly = BooleanEnum.True
e.Form.Controls("cbb_结束时间").ReadOnly = BooleanEnum.True
e.Form.Controls("CBB_提醒提前").ReadOnly = BooleanEnum.True
e.Form.Controls("CB_提醒").ReadOnly = BooleanEnum.True
End If

--  作者:大红袍
--  发布时间:2015/6/29 21:42:00
--  

If _Username <> e.Form.Controls("TB_录入人").Value Then
    Dim ary() As String = {"TB_内容", "TB_过程备忘"}
    For Each s As String In ary
        e.Form.Controls(s).ReadOnly = BooleanEnum.True
    Next
End If