Solved

CheckBox Properties change by Event

Posted on 2004-04-08
4
190 Views
Last Modified: 2012-05-04
Is there a way to change the background color of the "box" in the checkbox object based on an event?
0
Comment
Question by:gpotenza
4 Comments
 
LVL 10

Accepted Solution

by:
perkc earned 250 total points
ID: 10785423
I don't believe that checkbox background colors can be changed at all. You could however put a label underneath the checkbox and change the label's color based on an event. You would just need to bring the checkbox to the from to make sure it's on top of the label.

Changing the label's color would be:

Me.LabelName.BackColor = 10079487 ' Numeric value to indicate the color

perkc
0
 
LVL 12

Expert Comment

by:nexusnation
ID: 10785498
I agree with perkc.

You could also go as far as using a label with a bolded X as the checkbox, which toggles the checkbox that would be hidden underneath.

It could be as simple as:

Private Sub label1_Click()
Select Case Me.checkbox
Case True
Me.label1.Caption = "X"
Me.label1.Forecolor = vbGreen
Case False
Me.label1.Caption = ""
Me.lbl1.Forecolor = vbRed
End Select
End Sub

Or, to make it simplier, just use the red and green for off and on, and forget about the label's caption of "X". It would look pretty good too.

Andrew
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now