Radio groups in MFC
- How can I group several mfc radio boxes into a single group?
- Is it possible to bind a variable (preferably integer indicating the checked radio or boolean array) to such group. By binding I mean us开发者_开发百科ing
DDX_*
.
The radio buttons must be adjacent in Tab order. The tab order is editable from Visual Studio's Dialog Editor (Find a 'Tab Order' menu item, Ctrl-D was the shortcut in VS 2005). Then you have to arrange the radio buttons by clicking them in order. For the first radio button in the tab group you have to set its Group property to True. You should also select the control that follows your group of radio buttons and set its Group property to True too. This way the radio buttons will form a group and will behave as expected (check to see how the keyboard arrows work when some of the radio buttons has the focus).
You can bind the set of radio buttons after configuring them as above via DDX_Radio macro. See: http://msdn.microsoft.com/en-US/library/fchz3yh5(v=VS.80).aspx
精彩评论