|
-
Oct 27th, 2006, 04:33 PM
#1
Thread Starter
Member
[RESOLVED] Append on textbox?
How can i append some strings on an textbox?
More than than how can i do that by starting at the next line? Is there a carriage return character that i can append as well? Is that the char(13)?
example
if my text box has contents
"hallo"
i want to code it so it says
"hallo
world"
Any ideas?
Thnx
-
Oct 27th, 2006, 04:50 PM
#2
Fanatic Member
Re: Append on textbox?
VB Code:
Me.TextBox1.Text = Me.TextBox1.Text & Microsoft.VisualBasic.vbCrLf & "World"
Warren Ayen
Senior C# Developer
DLS Software Studios ( http://www.dlssoftwarestudios.com/)
I use Microsoft Visual Studio 2005, 2008, working with Visual Basic and Visual C#
Hey! If you like my post, or I solve your issue, please Rate Me!
-
Oct 27th, 2006, 04:52 PM
#3
Re: Append on textbox?
VB Code:
TextBox1.AppendText(Environment.NewLine & "World")
'TextBox1.Text = TextBox1.Text & ControlChars.NewLine & "Another way of appending text and [Enter] key to textbox"
Edit: And make sure that the Multiline property of textbox is set to True.
Last edited by Harsh Gupta; Oct 27th, 2006 at 04:57 PM.
-
Oct 28th, 2006, 12:04 AM
#4
Re: Append on textbox?
to append text simply use:
TextBox1.AppendText("Additional text here")
or
TextBox1.Text &= "Additional text here"
-
Oct 28th, 2006, 03:21 AM
#5
Thread Starter
Member
Re: Append on textbox?
Thanks everybody. Didnt mention that i am programmin on the compact framework, hence neither the AppendText exists nor the Enviroment.Newline.
However solved the problem by writing
TextBox1.text = TextBox1.Text & vbnewline & "New text"
Thanks again
-
Oct 28th, 2006, 10:02 PM
#6
Re: Append on textbox?
You will get some tiny improvement by changing that solution to:
textbox1.text &= vbNewLine & 'new text'
My usual boring signature: Nothing
 
-
Oct 28th, 2006, 10:15 PM
#7
Re: Append on textbox?
Argh! This is a duplicate thread.
http://www.vbforums.com/showthread.php?t=435203
One thread per topic and one topic per thread please.
-
Oct 28th, 2006, 10:27 PM
#8
Re: Append on textbox?
Actually, the topic is only closely related. That other thread appears to be a superset of the current thread. However, the current thread should be marked as resolved.
My usual boring signature: Nothing
 
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
|