I want to lock a CheckBox there's no .Locked property on CheckBox and I DON'T WANT TO DISABLE IT.
So if some one have hints, please Help.
MageMinds
Printable View
I want to lock a CheckBox there's no .Locked property on CheckBox and I DON'T WANT TO DISABLE IT.
So if some one have hints, please Help.
MageMinds
Hi MageMinds,
Assuming that you don't want to make it invisible, you can try this code:
in the click event of the check box. This will always keep it unchecked. Change 0 above to 1 if you always want it checked. However, it's neater to manipulate the check box by disabling or enabling it. But you don't want to do that for some reason. :confused:Code:Check1.Value = 0
Hope this helps.
I have tried to set the NOT value on the CLick Event but when I change it at Run Time the Click event is trigged, well I run Stack Overflow.
The CheckBoxes doesn't have always the same value, values are from a Database.
[Edited by MageMinds on 03-21-2000 at 12:43 PM]
Try this:
You need to have something like "blDoneCheck" because if youCode:Option Explicit
Private blDoneCheck As Boolean
Private blWanttoLock As Boolean
Private Sub Form_Load()
blWanttoLock = False
End Sub
Private Sub Check1_Click()
If blWanttoLock = True Then
If blDoneCheck = True Then
blDoneCheck = False
Exit Sub
End If
If Check1.Value = 0 Then
blDoneCheck = True
Check1.Value = 1
Else
blDoneCheck = True
Check1.Value = 0
End If
End If
End Sub
do check1.value = 0 it fires the Check1_Click event again and it will loop eternelly... ;)
Thanks a lot ... I was looking for an API to do the job but it's working fine ...
MageMinds