Link to home
Start Free TrialLog in
Avatar of chrisdl
chrisdl

asked on

Owner Draw radio button

I want (need) to be able to create radio buttons that are owner-drawn (like a CBitmapButton) but still act like radio buttons.

I tried setting BS_OWNERDRAW in my .RC file and writing a class similar to CBitmapButton but with a DrawItem that tests GetCheck() value and draws the appropriate bitmap (down for checked, up for unchecked, etc.)

But this did not work - BS_OWNERDRAW is 0x0b and BS_AUTORADIOBUTTON is 0x09 (1011 and 1001). If you OR them, you get 0x0b - BS_OWNERDRAW. Consequently, the button acts as if it were a normal CBitmapButton and the GetCheck() member always returns 0, even if I do a SetCheck(1) immediately before.

So, is there any reasonable way to do this?
ASKER CERTIFIED SOLUTION
Avatar of Tommy Hui
Tommy Hui

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial