Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a group of four radio buttons from a class derived from CButton. While creating, I am setting the styles as "WS_CHILD | WS_VISIBLE | WS_TABSTOP |BS_OWNERDRAW | BS_AUTORADIOBUTTON | WS_GROUP" for first radio and for rest i am setting "WS_CHILD | WS_VISIBLE | WS_TABSTOP |BS_OWNERDRAW | BS_AUTORADIOBUTTON"
I have overridden the DrawItem function in the button class, but when the program is executed the buttons are drawn, but i can not select any button, they are not getting selected at all.
this is the codeline i am using

DrawFrameControl(&rect, DFC_BUTTON,DFCS_BUTTONRADIO | ((lpDrawItemStruct->itemState & ODS_SELECTED)?DFCS_CHECKED : 0));

Please tell me if i am missing anything.
Posted
Updated 31-Mar-11 23:30pm
v2

1 solution

I don't know what is wrong in your code, but try to compare with this one:
Custom Draw Buttons & A Smarter Groupbox[^]
This guy is drawing owner draw radio buttons, you can download his code and compare it to yours. You will maybe find an answer there.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900