I understand the following :
You want to create a kind of custom TextBox. For the understanding of this you can use the following code :
Public Class myTextBox
Inherits System.Windows.Forms.TextBox
Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs)
Dim Taste As Keys = e.KeyCode
Select Case Taste
Case Keys.Enter, Keys.Escape
e.Handled = True
Case Else
Beep()
e.Handled = True
End Select
End Sub
Protected Overrides Sub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs)
Dim Taste As Char = e.KeyChar
Select Case Taste
Case "0" To "9"
Case "+"
Case "-"
Case ".", ","
End Select
e.Handled = True
End Sub
end class
Inside the overrided Sub's you could do, what you imagine (or think what shall happen).
The Result is that you have you own "spezified" TextBox which inherits from the Standard-TextBox ...
Greetings
Ralf