选择全部到mfc中的复选框 [英] select all to checkboxs in mfc
本文介绍了选择全部到mfc中的复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友们,
我可以选择复选框1(选择所有选项)剩下的所有复选框也会选择。
我想要select_all选项复选框代码示例
Hi friends,
I can select checkbox1(selectall options) remaining all checkbox will also select.
I want select_all option checkboxes code sample
推荐答案
创建ON_BN_CLICKED
全选复选框的处理程序。
在处理程序内调用SetCheck
表示所有复选框应该检查的控件。通过使用复选框的对话框成员变量(如果存在)或使用GetDlgItem
传递控件标识符来执行此操作。
使用复选框的连续标识符时,可以简化此过程。然后你可以使用for
循环访问控件。
Create aON_BN_CLICKED
handler for the "Select All" check box.
Inside the handler callSetCheck
for all the check box controls that should be checked. Do this by using the dialog member variables of the check boxes if present or usingGetDlgItem
passing the control identifiers.
This process can be simplified when using consecutive identifiers for the check boxes. Then you can use afor
loop to access the controls.
这篇关于选择全部到mfc中的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文