Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make CheckBox "ReadOnly" ? 1

Status
Not open for further replies.

MickeD

Programmer
Feb 20, 2000
54
0
0
I have some TextBoxes and CheckBoxes on the form.
In read only mode I set the "Locked" Property of TextBoxes to True .
I need do the same for CheckBox (setting "Enabled" = False makes the checkBox to Grayed, it's not acceptable)
May be some Third Part ActiveX Control has "Locked" property
or better way some API function?
Please help , it's very urgent
 
You could use the GotFocus event of the CheckBox to set focus to some other control. If you do that, focus will moved to whatever control you specify before the user can change the value of the CheckBox.

Josh
 
Great solution, man !
It's work
Thanks a lot!
 
Can you set chkBox.Enable = False and then at runtime set chkBox.Value = False in order to make it white?
 
if you don't want the focus to change to another control, you could also set the value of the check box to 1, and then put

Code:
	chkbox.value = 1
into the click event of the box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top