TextBox UserControl Problem
i am creating an UserControl in VB.net in which i have a textbox which contain properties like AllowOnlyNumeric,AllowOnlyCharacher etc so that i dont's have to code for these validations again n again plz give me some code to do that ASAP.
I am doing something like this
VB Code:
Private Sub TextBox1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
If varOnlyNumber = True Then
'If Char.IsLetter(CChar(TextBox1.Text)) = True Then TextBox1.Text = ""
'If IsNumeric(e.KeyValue) Then e.KeyData.Clear()
End If
If VarOnlyString = True Then
If Char.IsDigit(CChar(TextBox1.Text)) = True Then TextBox1.Text = ""
End If
End Sub
Re: TextBox UserControl Problem
This might beling in the .NET forums.
Re: TextBox UserControl Problem
Have you tried searching the VB.NET forum or CodeBank? There are several examples for a numbers only textbox, etc.