MFC 中的无线电组
- 如何将多个 mfc 单选框分组为一个组?
- 是否可以将变量(最好是指示检查的单选或布尔数组的整数)绑定到此类组。我所说的绑定是指使用
DDX_*
。
- 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 using
DDX_*
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
单选按钮必须按 Tab 键顺序相邻。 Tab 键顺序可通过 Visual Studio 的对话框编辑器进行编辑(查找“Tab 键顺序”菜单项,Ctrl-D 是 VS 2005 中的快捷方式)。然后您必须按顺序单击单选按钮来排列它们。对于选项卡组中的第一个单选按钮,您必须将其 Group 属性设置为 True。您还应该选择单选按钮组后面的控件,并将其 Group 属性也设置为 True。这样,单选按钮将形成一个组,并按预期运行(检查当某些单选按钮具有焦点时键盘箭头如何工作)。
通过 DDX_Radio 宏按上述配置后,您可以绑定单选按钮组。请参阅:http://msdn.microsoft.com/ en-US/library/fchz3yh5(v=VS.80).aspx
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