Question Insert numbers in a single textbox in 5 steps and then auto increment

jamms

Member
Joined
Dec 21, 2014
Messages
7
Programming Experience
Beginner
Hi guys...

I'm trying to do the following:

When I click ButtonA for the first time, it will entered a number "1" in a textbox.
If I click it again, another "1", up to five number "1".
After that, it should enter one number "2"... after five number "2", starting entering "3"... etc
So for example 111111222222333333444444

Second part is:
When I click ButtonB it should clear the 5 left most items of this line.
So if we have 111111222222333333444444, and click once, we will get 222222333333444444
if we click again, 333333444444

Thanks!
 
For the first part, store two numbers in separate variables: the next digit to enter and the count of the times that digit has been entered. When you click the button, enter the first digit into the TextBox and then increment the second number. If the second number is 5 then reset it to zero and increment the first number.

For the second part, it's a simple case of using Substring.
 
Back
Top