1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Namespace MonProjet
Public Class SelfValidatingTextBox
Inherits TextBox
Implements IValidator
Private _Required As Boolean
Private _RequiredType As String = "string"
Private _ErrorMessage As String
Private _IsValid As Boolean
Private _TypeValidator As New TypeValidator()
Public Sub New()
MyBase.New()
End Sub
Public Overridable Sub Validate()
' Si le TextBox est caché ou indisponible il doit renvoyer IsValid = true
If Not MyBase.Visible OrElse Not MyBase.Enabled Then
Me.IsValid = True
Return
End If |