CheckBox click event

S

Steve

In the click event for a checkbox, I am validating some data. If the
validation fails, I want the checkbox to remain unchanged(IE: If it was
checked before the last click and the validation fails, I want it to remain
checked)

Now, I can handle this with code that is less that pretty, but I thought
there might be a way to cancel an event or something. Basically, I'm asking
if there is a .NET native way to revert a control to it's previous state in
an event handler.

Thanks!
 
H

Herfried K. Wagner [MVP]

Steve said:
In the click event for a checkbox, I am validating some data. If the
validation fails, I want the checkbox to remain unchanged(IE: If it was
checked before the last click and the validation fails, I want it to
remain
checked)

Take a look at the control's 'AutoCheck' property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top