|
-
May 24th, 2000, 03:45 AM
#1
Thread Starter
PowerPoster
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.
-
May 24th, 2000, 03:53 AM
#2
transcendental analytic
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
Code:
Declare Function SetBkColor Lib "gdi32" Alias "SetBkColor" (ByVal hdc As Long, ByVal crColor As Long) As Long
on it. I'll have a look on it later
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 24th, 2000, 06:46 AM
#3
Thread Starter
PowerPoster
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.
-
May 24th, 2000, 03:11 PM
#4
transcendental analytic
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.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|