Private Sub Form_Open(Cancel As Integer)
Dim ctl As Access.Control
For Each ctl In Me.Controls
If ctl.locked=trueThen
ctl.BackColor = 14024186
End If
Next
End Sub
If句里面的CTL属性应该如何写。。请指教。
[此贴子已经被作者于2007-1-31 16:19:07编辑过]
作者: sgrshh29 时间: 2007-2-1 00:30
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
If ctl.Locked Then
ctl.BackColor = &HFF00F0
End If
End If
Next 作者: 一点通 时间: 2007-2-1 00:30
用系统默认的就会不同的底色作者: sybai 时间: 2007-2-1 00:32
谢谢大家的回复,此问题我已解决,
代码如下:
Private Sub Form_Open(Cancel As Integer)
Dim ctl As Access.Control
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acTextBox
If ctl.Locked = True Then ctl.BackColor = 14024186
Case acComboBox
If ctl.Locked = True Then ctl.BackColor = 14024186
End Select
Next
End Sub作者: piaoran 时间: 2007-12-11 16:15
收藏了,学习下,以后俺也用的上!
哈哈
谢谢啊