If TextBox1.TextLength > 10 Then
'Inform the user or do something
End If
Or much simpler, use the MaxLength property of the TextBox, and as for validating it you can simply use the Validating to return a Long.Tryparse(CType(sender, TextBox).Text, New Integer)You can achieve this by making use of the 'TextLength' property of the textbox control.
Ex:
VB.NET:If TextBox1.TextLength > 10 Then 'Inform the user or do something End If
Also, you can validate the test using 'IsNumeric'.