目标是:如果控件文本框 “11code”的值在表“材料库”中“材料编码”列中可以找到,则控件 "11name","11length","11weight","11height" ,"11width"不可编辑
测试发现不成功。
错误提示:没有为字符串“[材料编码] = '” 和 类型“TextBox” 定义运算符“&”
请问在窗口中引用该怎么写
代码如下:
Dim ctl As WinForm.Control = e.Sender
Select Case ctl.name
Case "11name","11length","11weight","11height" ,"11width"
Dim dr As DataRow = DataTables("材料库").Find( "[材料编码] = '" & e.Form.Controls("11code") & " ' ")
If dr IsNot Nothing
ctl.ReadOnly = BooleanEnum.False
ctl.error = "自有材料禁止修改尺寸/重量!"
End If
End Select