Solved

CheckBox Properties change by Event

Posted on 2004-04-08
4
195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

717 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