Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!
In my MFC dialogue based application there are 32 checkboxes which are arranged as 8*4. So my doubt is whenever I click on one of the check box in row then there should be disable remaining three checkbox of respective column!!
Now I write code for all check boxes individually for all 32 checkboxes event handler as given below:
C#
void Check_Test::OnBnClickedcheck1()
{
    // TODO: Add your control notification handler code here
    if(btn_check1.GetCheck()!=BST_CHECKED)
    {
        GetDlgItem(IDC_CHECK9)->EnableWindow(1);
        GetDlgItem(IDC_CHECK17)->EnableWindow(1);
    }
    else
    {
        GetDlgItem(IDC_CHECK9)->EnableWindow(0);
        GetDlgItem(IDC_CHECK17)->EnableWindow(0);
    }
}

So is there any common function or control for all check box behaviour??
Thanks in advance!!!
Posted

1 solution

To achieve this behavior I would better use Radio Buttons - just group the radio buttons column-like! In this case there is no coding necessary than: the checking one of the button will cause the un-checking the rest of the buttons in the same column.
 
Share this answer
 
v2
Comments
Venkat Raghvan 27-Feb-13 9:14am    
But in that respective row of check box we can select multiple,so in radio button control this is not possible!!
This is main problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900