How to change the color of the check box?

Anyone has a easy way to change the background color of the Checkbox? (not the background color of the caption, just the background of the square of the checker)...
LVL 9
DalinAsked:
Who is Participating?
 
amebaConnect With a Mentor Commented:
how to add and use custom checkboxes in VB's TreeView control
http://www.mvps.org/btmtz/treeview/

Your Checkbox is in treeview, right?
0
 
mcriderCommented:
Interresting question...
0
 
caraf_gCommented:
It looks like this is not actually possible. I've heard it mentioned (forgot where) that the colour in the little square is actually made out of a little bitmap. That's why it cannot be changed.

Indeed an interesting question. I hope someone will prove me wrong.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
amebaCommented:
I normally mention 'windows standards' with this type of question. :)
0
 
caraf_gCommented:
Hm... did a little test...

Changed the window appearance settings, and, most importantly, the window colour from white to something else. The little square changed too. Bang goes my theory about the bitmap.

I think this is the right moment to mention window standards too. <g>
0
 
mcriderCommented:
If you really want to do this, what about faking it by using a picturebox...  You could load and clear a picture of a checkbox and have whatever color you want...


Cheers!
0
 
DalinAuthor Commented:
I am dealing with regular input box.  The user input screen I always change the backcolor when the control(text, combo,) receive focus, and change to another when it is done.

I don't want to change the the windows setting for that.
I guess I have to make my own checkbox for that ability.

ameba, I did get a good tip from the site you posted. So I am awarding you the points.  Thanks,

Thanks to all for your comments.

0
 
DalinAuthor Commented:
BTW, Condratulations on making the top15 list. Good job, ameba!
0
 
amebaCommented:
Thanks.
I use color color to indicate value, e.g.:
    ' colorize textbox (black - normal, blue - changes, red - errors)
    If Len(mErrorText) Then
        TextBox.ForeColor = vbRed ' invalid value
    Else
        If TextBox.Parent.loading Then
            TextBox.ForeColor = vbWindowText
        Else
            TextBox.ForeColor = vbHighlight
        End If
    End If

I would like to know what are 'your' colors and if you are putting code in GotFocus/LostFocus of all controls.
0
 
DalinAuthor Commented:
Before it receive any entry--White
 GotFocus:  Yellow
 LostFocus: Green

I put code in the validating event so the cursor will not leave the box without a valid entery.
0
 
amebaCommented:
Thanks for the info. It sounds like very good way to improve usability.
0
All Courses

From novice to tech pro — start learning today.