mardi 30 décembre 2014

Preventing a checkbox Checked event

I have a checkbox which on checking it I want to ask the user if he is sure and if not I will cancel the operation.

I tried the Click event but it turnes out it is only beeing called after the CheckedChanged event.

I thought I could at least do it "ugly" by asking the user inside the CheckedChanged event but then if he wishes to cancel I need to change the Checked value what raises the event all over again.

Another thing I would preferd to avoid with this solution is that even before the user replies the 'V' appears in the checkbox. I'm looking for an event that happens before the CheckedChanged and if such an event exists a way to prevent the CheckedChanged event.

Any other idea would be great as well of course.





Aucun commentaire:

Enregistrer un commentaire