Results 1 to 3 of 3

Thread: TextBox UserControl Problem

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    12

    Question 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:
    1. Private Sub TextBox1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
    2.         If varOnlyNumber = True Then
    3.             'If Char.IsLetter(CChar(TextBox1.Text)) = True Then TextBox1.Text = ""
    4.             'If IsNumeric(e.KeyValue) Then e.KeyData.Clear()
    5.         End If
    6.  
    7.         If VarOnlyString = True Then
    8.             If Char.IsDigit(CChar(TextBox1.Text)) = True Then TextBox1.Text = ""
    9.         End If
    10.     End Sub
    Last edited by Hack; Sep 24th, 2005 at 05:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width