Results 1 to 4 of 4

Thread: [RESOLVED] How to count characters when user type in textbox and display it in label ?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Resolved [RESOLVED] How to count characters when user type in textbox and display it in label ?

    Hi all i got a textbox that user types a name. I want some how show the number of characters shown in label during user typing and warn him if he exceed for example 10 characters or disable typing.could any one show me how this can done.

  2. #2
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: How to count characters when user type in textbox and display it in label ?

    You can set the max count on your textbox to 10.

    Or use. len(textbox1.text) to do a char count
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Re: How to count characters when user type in textbox and display it in label ?

    Quote Originally Posted by some1uk03 View Post
    You can set the max count on your textbox to 10.

    Or use. len(textbox1.text) to do a char count
    Thanks for you reply .But how i can show the char count while user type in label ?

    Code:
    Private Sub Command1_Click()
    Label1 = Len(Text1.Text)
    End Sub

  4. #4
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: How to count characters when user type in textbox and display it in label ?

    Code:
    Private Sub Text1_Change()
    Label1.Caption = Len(Text1.Text)
    End Sub

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