Check box label border

  • Thread starter Thread starter JROOT
  • Start date Start date
J

JROOT

I'm trying to figure out how to make the border of a label
that is attached to a check box appear when the check box
is selected. For example, I have a form with many check
box fields listed. It is difficult to tell which field
I'm selecting. I would like the label that is associated
with a particular check box to be outlined when the check
box is selected. I've seen it done in other
applications. I'm sure the solution is simple - like some
property setting, but I can't figure out how to do it.
Any ideas out there?
 
Try writing this code against the checkbox's Click event. Note the
Checked_Click() name is based on the value in the Name section of the Other
tab when in the properties of the checkbox.

The lblChecked part is based on the value in the Name section for the label
that is attached to the checkbox.

Private Sub Checked_Click()
If Checked = True Then
Me.lblChecked.BackColor = "16777215" ' white
Me.lblChecked.BackStyle = "1" ' Normal

Else
Me.lblChecked.BackColor = "16777215" 'white
Me.lblChecked.BackStyle = "0" ' Transparent
End If
End Sub
 
Back
Top