I have a UserControl, which does a validation on the Validated event, and on the screen, I have the Confirm button.
When I use the ALT + C shortcut to run the button event, it will perform validated event validation, and then the button event.
How do I cancel the button event when my UserControl validation fails?
I do not know if it was very clear, what I'm trying to do. If it's a bit confusing, here are some "prints" for better understanding:
UserControl:
Sourcecodeinform:
When I click the Confirm button on the screen, it works fine.
- Performs the Validated validation first, and returns. And it does not execute the message that is in the "Confirm" button
As I said above, if you run through the ALT + C shortcut, it will trigger both events.
Does anyone have a solution for this?