Question[Help] Add to TextBox[Solved]

Posts 1–10 of 10 · Page 1 of 1
[Help] Add to TextBox[Solved]
How do you add additional words into textbox.text w/o messing up the lines already in the textbox.

for example.
in the textbox there is the line "Hello world!"

when i click this button it adds the word "Bye!" after the hello world"

so final text is "Hello World!Bye"
textbox1.text = "Bye!"


try that one
lol it will erase the line "Hello World!".....
Quote Originally Posted by ppl2pass View Post
How do you add additional words into textbox.text w/o messing up the lines already in the textbox.

for example.
in the textbox there is the line "Hello world!"

when i click this button it adds the word "Bye!" after the hello world"

so final text is "Hello World!Bye"
textbox1.text+="Bye !"

Have fun dude
i read it wrong, i thought you didnt wanted that to happen xD
textbox1.text + ="Bye !"
is correct yea :P
nvm found it.
Quote Originally Posted by ppl2pass View Post
nvm found it.

btw how can i remove a space from the beginning of the textbox1.text.
Code:
Dim i as string = textbox1.text
Dim Flag as boolean=false
Dim final as string=""
For X as integer= 1 to i.length
dim c as string=mid(i,X,1)
if flag then 
Exit For
End if

If not c= " " Then
Flag=true
Continue For
Else
final +=c
End If

Next

Msgbox (Final)
I know you found the solution but you can change textbox to listbox. Make the first line say Hello World!

Then If Button1.Enabled = True The Listbox1.Add.Item("Bye!")

(not the exact code but around those lines)
His question is about a textbox...

anyways it is

listbox1.items.add("Bye")
And solved, so why is there 10 posts after ...?

Marked Solved, Don't post unless necessary
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us