-
Sep 19th, 2014, 01:01 AM
#1
Thread Starter
New Member
[RESOLVED] i want to split textbox to smaller textboxes
hi,
i want split textbox to other textboxes...
how can i do this?
i have a picture to show what i mean exacktly..
here: i want to split the textbox1.text to other textboxes below like the picture..
i dont know the code for split button..
can you help please?
thanks.
-
Sep 19th, 2014, 01:15 AM
#2
Re: i want to split textbox to smaller textboxes
The TextBox itself is actually irrelevant. The Text property of any control is a String and splitting any String on delimiters means using the String.Split method.
I'm not going to provide an example because there are loads around. Learning how to find relevant information once you've been told what type and or member to use is the first step to moving from being a beginner to an intermediate developer.
-
Sep 19th, 2014, 01:16 AM
#3
Re: i want to split textbox to smaller textboxes
If you think you know what to do but it doesn;t work, by all means post back and show us what you've done and tell us what happened and I'll be glad to help further. I'm keen to see an attempt first though, now that you know what you need to use.
-
Sep 19th, 2014, 01:18 AM
#4
Re: i want to split textbox to smaller textboxes
Use string split for that requirement.
Code:
Dim combination As String
Dim combinations() As String
combination = "10962-10532-33154"
combinations = combination.Split(New Char() {"-"c})
TextBox1.Text = combinations(0)
TextBox2.Text = combinations(1)
TextBox3.Text = combinations(2)
KGC
-
Sep 19th, 2014, 01:33 AM
#5
Re: i want to split textbox to smaller textboxes
Originally Posted by KGComputers
Use string split for that requirement.
Code:
Dim combination As String
Dim combinations() As String
combination = "10962-10532-33154"
combinations = combination.Split(New Char() {"-"c})
TextBox1.Text = combinations(0)
TextBox2.Text = combinations(1)
TextBox3.Text = combinations(2)
KGC
That overload of String.Split actually has its `separator` parameter declared as a ParamArray. That means that there's no need to actually create an array yourself. You simply pass zero, one or more discrete values and they get combined into an array implicitly. Zero arguments means split on whitespace characters, e.g. spaces and tabs, while one or more arguments means split on any matching characters.
-
Sep 19th, 2014, 02:21 AM
#6
Re: i want to split textbox to smaller textboxes
Oh, thanks for pointing it out..
-
Sep 19th, 2014, 02:45 AM
#7
Thread Starter
New Member
-
Sep 19th, 2014, 03:10 AM
#8
Re: i want to split textbox to smaller textboxes
Don't forget to mark this thread as resolved.
KGC
-
Sep 19th, 2014, 03:15 AM
#9
Thread Starter
New Member
Re: i want to split textbox to smaller textboxes
ok
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|