G
Guest
I want to be able to intercept the click of a checkbox to cancel a change in
its checked state under certain conditions to prevent the execution of code
attached to the CheckedChanged event. So when someone clicks on the checkbox
I want to do some validation and on failure throw the click away, leaving the
state of the checkbox unchanged.
I was looking for Cancel or Handled to manage it, but I can't find it. I
suppose I could short-circuit the CheckedChanged event to flip the checked
state back and skip the code, using a Boolean flag to skip the second call to
CheckedChanged when I change the state back, but that's ugly.
Any suggestions would be appreciated.
its checked state under certain conditions to prevent the execution of code
attached to the CheckedChanged event. So when someone clicks on the checkbox
I want to do some validation and on failure throw the click away, leaving the
state of the checkbox unchanged.
I was looking for Cancel or Handled to manage it, but I can't find it. I
suppose I could short-circuit the CheckedChanged event to flip the checked
state back and skip the code, using a Boolean flag to skip the second call to
CheckedChanged when I change the state back, but that's ugly.
Any suggestions would be appreciated.