### IsNumber accept Digits only

To check if a string is a number with digits 0-9 only, add a second check with RegEx.IsMatch.
' Accept digets 0-9 only
`Sub IsNumber3(s As String) As Boolean 'ignore
Return IsNumber(s) And Regex.IsMatch("[[0-9]]+", s)
End Sub`
' Example TextField change with setting CSS style accordingly
`Sub TextField1_TextChanged (Old As String, New As String)
' Empty field - reset styles
If New.Length = 0 Then
Label2.Text = $"Field is empty"$
CSSUtils.SetBorder(Sender, 2, fx.Colors.Transparent, 2)
CSSUtils.SetStyleProperty(Label2, "-fx-text-fill", "black")
Return
End If
' Invalid input
If Not(IsNumber3(New)) Then
Label2.Text = $"Non digit 0-9 entered."$
CSSUtils.SetBorder(Sender, 2, fx.Colors.Red, 2)
CSSUtils.SetStyleProperty(Label2, "-fx-text-fill", "red")
Else
' Valid input
Label2.Text = $"Valid digit 0-9 entered."$
CSSUtils.SetBorder(Sender, 2, fx.Colors.Transparent, 2)
CSSUtils.SetStyleProperty(Label2, "-fx-text-fill", "black")
End If
End Sub`

Changed: , Category: Numbers, File: T6C226M1673.htm, ID: 1673