Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Sample4 Sample (VB.NET)

This sample illustrates input validation.

The source code is located at C:\Program Files (x86)\Softelvdm\SftMask OCX 7.0\Samples\Visual Studio - VB.NET\Sample4\Form1.vb or C:\Program Files\Softelvdm\SftMask OCX 7.0\Samples\Visual Studio - VB.NET\Sample4\Visual Studio - VB.NET\ (on 32-bit Windows versions).

Private Sub buttonCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonCancel.Click
    Application.Exit()
End Sub

Private Sub buttonOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonOK.Click
    If axSftMaskName.Contents.Valid And _
            axSftMaskCompany.Contents.Valid And _
            axSftMaskZIP.Contents.Valid And _
            axSftMaskTelephone.Contents.Valid And _
            axSftMaskDate.Contents.Valid And _
            axSftMaskAmount.Contents.Valid Then
        ' save the data
        Application.Exit() '  and exit
    Else
        MessageBox.Show("There are validation errors - Please correct the data entered.")
    End If
End Sub

Private Sub axSftMaskZIP_CustomValidation(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_CustomValidationEvent) Handles axSftMaskZIP.CustomValidation
    If axSftMaskZIP.Text <> "11111" Then
        e.cancel = True
    End If
End Sub

Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.