Private Sub TextField1_TextChanged (Old As String, New As String)
Dim IsValid As Boolean = True
Try
If New <> "" Then
Dim t As Long = DateTime.DateParse(New)
Dim year As Int = DateTime.GetYear(t)
If year < 1900 Or year > 2100 Then IsValid = False
End If
Catch
IsValid = False
End Try
If IsValid Then
TextField1.SetColorAndBorder(xui.Color_White, 1dip, xui.Color_LightGray, 2dip)
Else
TextField1.SetColorAndBorder(xui.Color_White, 1dip, xui.Color_Red, 2dip)
End If
End Sub