Changing Check box colour

  • Thread starter Thread starter P
  • Start date Start date
P

P

Hi,

I am trying to change a check box color so it can match the background. I
cannot find a way to accomplish this. The check box remains white. Only the
border color changes. Any suggestion? Thank you. P
 
Hi,

I am trying to change a check box color so it can match the background. I
cannot find a way to accomplish this. The check box remains white. Only the
border color changes. Any suggestion? Thank you. P

It's like the Fort Model T, any colour you like, as long as it's
black. But in this case, white :-)
 
You'll have to work around the fact that the Check Box has no
BackColor setting and is also fixed in size.

Add a Label to your form.
(You'll need to enter a caption to get the label to 'stick'.
Enter just a space.)
Set the Font to Wingdings.
Set the Font Size as wanted.

Click on whatever background you wish to place the check box on (Form Detail
section?)
Display the section's property sheet.
Place your cursor in the BackColor line and copy the color.

Display the new Label's property sheet.
Paste the color of the detail section into the Label's BackColor property.
If you wish to also change the new checkbox's fore color, now is the time to
do it.

I think it looks best to have the SpecialEffect as Flat,
but that is your call.

Then code the Label Click event:
[CheckBoxField] = Not [CheckBoxField]
If [CheckBoxField] = -1 Then
LabelName.Caption = Chr(254)
Else
LabelName.Caption = "o"
End If

That's a small letter o above.

Also check it with Normal and Transparent BackStyles to see which
appears better on your form.

Code the Form's Current event:
If [CheckBoxField] = -1 Then
LabelName.Caption = Chr(254)
Else
LabelName.Caption = "o"
End If

Clicking on the Label is the same as clicking on the actual check box.
Add another label with the check box's field name as caption.

The actual check box itself should not be visible.
Change the names of the control's to whatever the actual control names are.
Hope this is suitable.
 
Back
Top