Code the
keypress
event of the textboxes. Allow numbers, the backspace key,
and the decimal point. Only write the code once and use Handles.
Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = ControlChars.Back Then
MessageBox.Show("error")
e.Handled = True
End If
End Sub