Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
Go Back  Xtreme Visual Basic Talk > > > Insert numbers in a single textbox in 5 steps and then auto increment


Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2015, 03:32 PM
Jamms Jamms is offline
Newcomer
 
Join Date: Dec 2014
Posts: 3
Default Insert numbers in a single textbox in 5 steps and then auto increment


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!
Reply With Quote
  #2  
Old 03-09-2015, 02:23 PM
CharlieMay's Avatar
CharlieMay CharlieMay is offline
Regular
 
Join Date: Sep 2009
Location: Indiana
Posts: 89
Default

Did you even try to do this yourself. It's literally 3 lines of code (not including the event subs and end subs)

Start x at 0 in a global scope
Check if the length of the textbox.text mod 5 = 0 and if so increment x by 1
use appendtext to append x.tostring to the textbox

for the second part.
Ensure that the length of text in the textbox is greater than or equal to 5
Set the textbox's .Text property to its current Text.SubString(5)
__________________
I thought I knew what I was doing...
...And then I turned on Option Strict
Reply With Quote
  #3  
Old 03-10-2015, 04:29 PM
passel's Avatar
passelInsert numbers in a single textbox in 5 steps and then auto increment passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,024
Default

Actually as presented it is impossible to do.
Quote:
Originally Posted by Jamms View Post
...
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
...
Every example has six repeating digits in each group, and there is no way to to "clear the 5 left most items", and end up with six digits removed from the string.

This question was also posted in VBForums and already had a number of responses there which is why it sat idle here as it had already been resolved.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
 
Insert numbers in a single textbox in 5 steps and then auto increment
Insert numbers in a single textbox in 5 steps and then auto increment
 
-->