Counting number of characters in a text box 
Author Message
 Counting number of characters in a text box

Hey,

I was wondering if there is a way to count the number of characters that
you enter into a text box. The easiest way that I can think of giving an
example of this is, using ICQ 99, when you send a message it counts the
number of characters each time you type something into the dialog box.
Is there a way that I can do that in VB6? If so, does anyone have some
code that I could use to accomplish this?

Thanks,

Adam



Mon, 29 Oct 2001 03:00:00 GMT  
 Counting number of characters in a text box
Just determine the length of the text:

Label1 = Len(Text1)

B-Mann


Quote:
> Hey,

> I was wondering if there is a way to count the number of characters that
> you enter into a text box. The easiest way that I can think of giving an
> example of this is, using ICQ 99, when you send a message it counts the
> number of characters each time you type something into the dialog box.
> Is there a way that I can do that in VB6? If so, does anyone have some
> code that I could use to accomplish this?

> Thanks,

> Adam



Mon, 29 Oct 2001 03:00:00 GMT  
 Counting number of characters in a text box
Len(Text1.Text)
will give you the lenght of the string. (= Number Of Characters)


Tue, 30 Oct 2001 03:00:00 GMT  
 Counting number of characters in a text box


Quote:
>Hey,

>I was wondering if there is a way to count the number of characters that
>you enter into a text box. The easiest way that I can think of giving an
>example of this is, using ICQ 99, when you send a message it counts the
>number of characters each time you type something into the dialog box.
>Is there a way that I can do that in VB6? If so, does anyone have some
>code that I could use to accomplish this?

>Thanks,

>Adam

Try this:

Private Sub Text1_Change()
        Dim n as Long  

        n = Len(Text1)   'Len returns number of characters in the

                        'string as a Long integer
End Sub



Fri, 02 Nov 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Counting Characters in a text box, and makeing a countdown timer

2. Count numbers in a text box

3. Using API or other method to count number of lines in a Rich Text Box

4. Column (character) numbers in Rich Text Box

5. Text box number of characters VB6

6. Counting the number of occurrences of a character...

7. Counting lines of text in a text box ????

8. Ignore strikethrough text in document character count

9. Scanning text & objDoc.Characters.Count

10. Text from vba text box (>2000 characters) to a Word bookmard

11. Count number of words in text

12. Counting number of lines in text files, and outputting to excel sheet

 

 
Powered by phpBB® Forum Software