Solved

CheckBox Properties change by Event

Posted on 2004-04-08
4
194 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

733 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