I 'd created a simple form , it consist of 2 set of checkboxs
I want to make a simple function determine if the first checkbox in set1 is checked it must test the checkboxes in set2 if the first is checked too or not .Any idea please???
all inside the form , I want to make a test function , make a test with the checked item and the item is against it , if checkbox2 is checked and checkox5 is checked too a messagebox appear , display a text ....etc
if not an error meassagebox appear ..etc not just checkbox 2&5 may be inside the form there are 50 checkbox's I can't in each item make a comperision .....can any one help???
Just a thought... have you considered using a binary value to represent each group ?
Set the Tag value for each checkbox with a hex value. Have a method OR the hex values for each checkbox (method will iterate through all checkboxes in a group) resulting in a single value for each group.
Hint: if you have each checkbox group contained in a panel or groupbox it makes it easier to iterate all checkboxes in that container rather than filter on all checkboxes on the form.
Once you have a single binary value for each checkbox group. You can (AND) the value with the other group(s) to see which combinations are checked as a single value.
If you have some known conditions (like that one which creates an error message), then you can AND that condition (as a binary value) to the checkbox group binary values.
Its just a matter of math.
If this sounds confusing, consider it this way. If you can represent Group A as a single value, then you can use simple boolean operators to compare against specific conditions you want to check.