HeaderPane
Main
Hide
Share Link
Print

ValidationErrorEventArgs Class

Provides data for the SftMask.ValidationError event.

Namespace: Softelvdm.SftMaskNET
Assembly: Softelvdm.SftMaskNET

Inheritance

Syntax

public class ValidationErrorEventArgs : System.EventArgs;
Public Class ValidationErrorEventArgs
    Inherits System.EventArgs

Constructors

This class cannot be instantiated.

Properties

PublicPositionReturns the first position that is not valid, or -1 when no position is at fault (ValidationErrorReasonEnum.Custom).
PublicReasonReturns why the contents are not valid.
PublicValidatingReturns whether the error was found while the control was validated (Validating event) rather than by the SftMask.ValidateContents method.

Fields

PublicStaticInherited from System.EventArgsEmptyProvides a value to use with events that do not have event data.

Methods

PublicInherited from System.ObjectEqualsDetermines whether the specified object is equal to the current object.
ProtectedInherited from System.ObjectFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
PublicInherited from System.ObjectGetHashCodeServes as the default hash function.
PublicInherited from System.ObjectGetTypeGets the Type of the current instance.
ProtectedInherited from System.ObjectMemberwiseCloneCreates a shallow copy of the current Object.
PublicStaticInherited from System.ObjectReferenceEqualsDetermines whether the specified Object instances are the same instance.
PublicInherited from System.ObjectToStringReturns a string that represents the current object.

Examples

C# View entire sample code

        private void sftMask1_ValueChanged(object sender, EventArgs e) {
            DumpValues("sftMask1.ValueChanged (" + (sftMask1.Value.HasValue ? sftMask1.Value.Value.ToString() : "none") + ")", e);
        }

        private void sftMask1_InputRejected(object sender, InputRejectedEventArgs e) {
            DumpValues("sftMask1.InputRejected", e);
        }

        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);

VB.NET View entire sample code

        End If
        DumpValues("SftMask1.ValueChanged (" + value + ")", e)
    End Sub

    Private Sub SftMask1_InputRejected(ByVal sender As Object, ByVal e As InputRejectedEventArgs) Handles SftMask1.InputRejected
        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)

See Also Classes | SftMask/NET 3.0