Occurs when the contents are validated, after the mask's own checks passed; setting Cancel makes them not valid.
Class: SftMask
Namespace: Softelvdm.SftMaskNET
Assembly: Softelvdm.SftMaskNET
public event CancelEventHandler CustomValidation;
Public Event CustomValidation As CancelEventHandlerOccurs when the contents are validated, after the mask's own checks passed; setting Cancel makes them not valid.
private void sftMask1_ValidationError(object sender, ValidationErrorEventArgs e) {
DumpValues("sftMask1.ValidationError", e);
}
// Amounts over 10,000 are not accepted.
private void sftMask1_CustomValidation(object sender, CancelEventArgs e) {
e.Cancel = sftMask1.Value.HasValue && sftMask1.Value.Value > 10000;
DumpValues("sftMask1.CustomValidation" + (e.Cancel ? " (over 10,000, refused)" : ""), e);
}
private void sftMask1_UpDownPress(object sender, UpDownPressEventArgs e) {
DumpValues("sftMask1.UpDownPress", e);
}
private void sftMask1_CalculatorOpening(object sender, CalculatorOpeningEventArgs e) {
e.Cancel = checkBlock.Checked;
DumpValues("SftMask1.InputRejected", e)
End Sub
Private Sub SftMask1_ValidationError(ByVal sender As Object, ByVal e As ValidationErrorEventArgs) Handles SftMask1.ValidationError
DumpValues("SftMask1.ValidationError", e)
End Sub
' Amounts over 10,000 are not accepted.
Private Sub SftMask1_CustomValidation(ByVal sender As Object, ByVal e As CancelEventArgs) Handles SftMask1.CustomValidation
e.Cancel = SftMask1.Value.HasValue AndAlso SftMask1.Value.Value > 10000
DumpValues("SftMask1.CustomValidation" + If(e.Cancel, " (over 10,000, refused)", ""), e)
End Sub
Private Sub SftMask1_UpDownPress(ByVal sender As Object, ByVal e As UpDownPressEventArgs) Handles SftMask1.UpDownPress
DumpValues("SftMask1.UpDownPress", e)
End SubSee Also SftMask Class | Classes | SftMask/NET 3.0