ListCtrl的cheek框的全选和反选
void SetAndAddSigDlg::OnBnClickedRadioAllSelect()
{
for (int i = 0; i < m_Sig_list.GetItemCount(); i++) {
m_Sig_list.SetCheck(i, TRUE);
m_Sig_list.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
}
}
void SetAndAddSigDlg::OnBnClickedRadioInvertSelect()
{
BOOL state;
for (int i = 0; i < m_Sig_list.GetItemCount(); i++) {
state = m_Sig_list.GetCheck(i);
if (state == FALSE) {
m_Sig_list.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
m_Sig_list.SetCheck(i, TRUE);
}
else {
m_Sig_list.SetItemState(i, ~LVIS_SELECTED, LVIS_SELECTED);
m_Sig_list.SetCheck(i, FALSE);