Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mfc group radiobuttons

Status
Not open for further replies.

Tdrgabi

Programmer
Jun 24, 2004
43
RO
hi, this is a very simple question ... but the answer eludes me.


I want to create a couple of radiobuttons and group them toghether ... from code using CButton.

i know how to make the buttons, i even make a group "button" ... but how can i tell the program that my radio buttons will be a part of that group button?
 
and how can i treat the messages that a button i created receives? MFC offcourse ...
 
For the first button in the group, and the first control after the last button in the window, set the style bit WS_GROUP. For all the other buttons, make sure the style bit WS_GROUP is _not_ set.
 
probably im a retard or something .. but i havent understood.
lets take it slow.

i have
CButton butGroup;
butGroup.Create (WS_GROUP,rect ....)
CButton butYear,butMonth;
butYear.Create(WS_RADIOBUTTON,rect....)
butMonth.Create(WS_RADIOBUTTON,rect....)

i want this two buttons to be a part of the butGroup group.
how can i group them?

and if i have a PushButton created with code ... how can i do something when its pressed ? how can i get the messages for him?
 
i have a class that extends the CEdit class ...
and two objects of that class on the screen.
everything works fine, but when i try to paint something in the edit ... or just add the Paint event ... all my text dissapears ... can i paint something in edit and then put the text on top of it???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top