views:

26

answers:

0

I have created a custom control that inherit the TextBox, in that control i have override validating event and in validating event i have put validation that checks for the empty field.

No when i use that control on my winform and when i click on save button it immediate fires save event.. the validation event of custom control fires and it displays the error message but still it does not stop the save event to fire....

the save button CauseValidation Property is set to true..

i have also put (this.ValidateChildren())

i have also put CancelEventArgs ce.Cancel = true;

but nither working the save event still fires..

i only want to fire Save event if Textbox is not empty. but validating event shows message for empty field and immidiate fires save event..

now if u got an idea then i you have solution then please provide solution..