I have a big problem over here on my calculator.

I have a dynamic refresh textbox, so on textbox\_change, it will automatically click the enter button.

```
Private Sub textBox_TextChanged(sender As Object, e As TextChangedEventArgs) Handles textBox.TextChanged
    If IsNumeric(textBox.Text) = False Then
        button.IsEnabled = False
    Else
        button.IsEnabled = True
    End If
    button_Click(sender, e)

End Sub

```

So as my button will break on any other keystrokes than integer is sent, everytime when a user sends backspace or delete when there is no other characters in the textbox, the program will crash.

My button code which will crash on anything other than integers and also on `button_click textbox.clear()` and keystrokes (backspace, delete)sent when there are no integers in the textbox, as I think it detects delete the keystroke as some other string and not UInt64.

```
    If IsNumeric(textBox.Text) Then
        b = CDbl(textBox.Text)
    Else
        Await Me.ShowMessageAsync("Error", "Please input a number.", MessageDialogStyle.Affirmative)
    End If

    Dim Input As ULong
    Input = Convert.ToUInt64(textBox.Text)
    textBox12.Text = (FormatNumber(Input))

    Dim m As Decimal
    Dim t As Decimal
    Dim add As Integer

    If b > 100000000 Then
        t = 0.06
    ElseIf b > 25000000 Then
        t = 0.05
    ElseIf b > 10000000 Then
        t = 0.04
    ElseIf b > 5000000 Then
        t = 0.03
    ElseIf b > 1000000 Then
        t = 0.018
    ElseIf b > 100000 Then
        t = 0.008
    End If

    m = b - (b * t)
    add = b - m
    textBox1.Text = add
    textBox2.Text = Int(m)

```

So how do I prevent it? As now no text can be cleared without being extremely cautious. It will crash with An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll. 
Can I stop delete and backspace when there is no characters in textbox.text? How do I do it? Please help!