lundi 28 septembre 2015

How to disable checkBox if other checkBox is checked c#

I have an array of checkBox in my windows form application. I am wondering is there a way to disable that array of checkBox if one or more checkBox in that array is checked?

for example: if A is checked, B,C,D,E is disabled if A, and C is checked, B, D, E is disabled

Sorry for the confusion. In the following example, A, C, E is checked. What I want is B, D then is disable

[x]A []B [x]C []D [x]E

This is my array list

Another example:

This example showed D is checked, then A, B, C and E should be disabled

[]A []B []C [x]D []E

Code:

CheckBox[] myCheckBoxArray = new CheckBox[5];

myCheckBoxArray[0] = checkBoxA 
myCheckBoxArray[1] = checkBoxB
myCheckBoxArray[2] = checkBoxC 
myCheckBoxArray[3] = checkBoxD 
myCheckBoxArray[4] = checkBoxE 




Aucun commentaire:

Enregistrer un commentaire