Portaljacker
Portaljacker

Reputation: 3142

Radio buttons in MFC (re-written)

So I'm working on a class project that uses MFC. I never had to learn how to work with MFC since I was making the character class stuff (D&D game).

I currently have the radio buttons working. So I know which was pressed and can retrieve it.

My problem is this: I have 2 radio buttons, which represent the 2 sets of 6 dice rolls to be used for stats.

I want to display a string containing the set for the specific radio button. So what I'm wondering is: is there a way to have the caption string for a radio button be equal to a specific string that can change between the times the dialog with said radio button is opened?

Edit: I changed the whole question since I solved all but this part of the original.

Upvotes: 1

Views: 1532

Answers (1)

Frédéric Hamidi
Frédéric Hamidi

Reputation: 263147

MFC wraps radio buttons in CButton instances, so you can use their SetWindowText() method:

yourRadioButton.SetWindowText(_T("New Text"));

Upvotes: 2

Related Questions