以下是引用don在2012-1-21 12:03:00的发言:
Dim cl as Col = Tables("表名").Cols("锁定")
Dim bn as Boolean =cl .AllowEdit
e.sender.text = iif(e.sender.text ="未锁定","已锁定","未锁定")
e.sender.BackColor = iif(e.sender.BackColor =Color.Red,Color.Green,Color.Red)
cl.AllowEdit = Not bn
按钮虽可切换包括颜色但并未锁定/解锁
方法三
Dim chk As WinForm.CheckBox
chk = Forms("窗口1").Controls("CheckBox1")
If chk.Checked = True Then
chk.text= "锁定"
CurrentTable.Current("锁定") = False
End If
If chk.Checked = False Then
chk.text= "解锁"
CurrentTable.Current("锁定") = True
End If
[此贴子已经被作者于2012-1-21 22:30:19编辑过]