Select Case dc.Caption
Case "规格", "产品品名", "产品名称"
dc.AllowEdit = False
Case .startwith("批号")
这里是否可以对dc.caption做字符串的判断?例如startwith或者length? dc.Unique=True
End Select
试试这个Select Case True
Case {"规格", "产品品名", "产品名称"}.contains(dc.Caption)
dc.AllowEdit = False
Case dc.Caption.startwith("批号")
dc.Unique = True
End Select