Does anybody out there know how to change the background of the check portion of a checkbox (not the caption portion, which can easily be done with the BackColor property)? I suspect that this must be done with the API. Thanks.
Printable View
Does anybody out there know how to change the background of the check portion of a checkbox (not the caption portion, which can easily be done with the BackColor property)? I suspect that this must be done with the API. Thanks.
I wouldn't be surprised if this doesn't work, especially if there's no childwnd in the checkbox. if there is you could use
on it. I'll have a look on it laterCode:Declare Function SetBkColor Lib "gdi32" Alias "SetBkColor" (ByVal hdc As Long, ByVal crColor As Long) As Long
I appreciate your speedy reply, kedaman, but unfortunately, your hunch was right, and the function did not work (unless I did something wrong). I put a checkbox and a command button on a form. I did a Private Declare with the API function you recommended, then in the Command1_Click event, I put:
Dim L as Long
L = SetBkColor(Check1.hWnd, vbButtonFace)
When I ran it and clicked the button, nothing happened.
If you come up with anything further, I'd be very grateful. Thanks again.
ACtually it's the childwnd, which background should be changed, but there's no childwnd, so i can't help you furher, you could probably make your own active-X, a checkbox should be the easiest thing to do.