Soldato
- Joined
- 13 Feb 2004
- Posts
- 2,656
- Location
- South Shields
Hi,
I'm trying to write some code into a VB program that will allow a label to display the amount of characters the user has to use in realtime.
For example if the user has 50 characters to use and they enter "hello" the label will read 45 Characters left.
I have a general understanding that the code will have to flow something like this -
But as I have declared the count as Integer it will only allow integers to be used..
how would I get this code to allow me to count individual characters as they are entered and then reduce the counter in the label by 1.
I know this is probably easy to do.. but tis been a long day and my mind isn't exactly on things at the mo..
Thanks for any help..
*edit*
This is in VB6 not VB.net..
Therefore i cannot use the .length either..
I'm trying to write some code into a VB program that will allow a label to display the amount of characters the user has to use in realtime.
For example if the user has 50 characters to use and they enter "hello" the label will read 45 Characters left.
I have a general understanding that the code will have to flow something like this -
Dim Count As Integer
Dim Max As Integer
Dim Sum As Integer
Dim Ttl As String
Max = 50
Ttl = txttitle
Count = Ttl
Sum = Max - Count
Label2 = Sum
But as I have declared the count as Integer it will only allow integers to be used..
how would I get this code to allow me to count individual characters as they are entered and then reduce the counter in the label by 1.
I know this is probably easy to do.. but tis been a long day and my mind isn't exactly on things at the mo..
Thanks for any help..
*edit*
This is in VB6 not VB.net..
Therefore i cannot use the .length either..
