Below is my code and I am having an issue where when you put a decimal to move to the next octet of the ip you can't put another decimal so instead of putting 10.10.10.10 you can only do 10.10 it doesn't allow you to put another decimal to continue on. It does work where you can't put any letters in I just can't get it to allow multiple decimals.
Private Sub Ip_TextChanged(sender As Object, e As TextChangedEventArgs) Handles _ip.TextChanged
If sender.Text <> String.Empty Then
Dim TypedNumber As String = sender.Text
Dim NumberRegex As String = "^[0-9]*\.?[0-9]*$"
If Not System.Text.RegularExpressions.Regex.Match(TypedNumber, NumberRegex).Success Then
sender.Text = sender.Text.Remove(sender.Text.Length - 1, 1)
sender.SelectionStart = sender.Text.Length
End If
End If
End Sub
Any help is appreciated! Thanks, Kyvex.