Multiline textbox - add text instead of overwriting it

Hi,

I have a multiline textbox, and I would like to add text to it when I click a button.  But when I use textbox1.text="something" it overwrites what was previously in the textbox.  I would like the text to be added to the existing text, but on a new line everytime I click the button.

Thanks guys.
jakekulaAsked:
Who is Participating?
 
DotNetLover_BaanConnect With a Mentor Commented:
Hi there...
use
textbox1.text &="something"  (for VB.Net)
textbox1.text +="something";  (for C#.Net)
0
 
DotNetLover_BaanCommented:
oops... missing "New line part"...  should be

textbox1.text &=VbCrLf & "something"  (for VB.Net)
0
 
jakekulaAuthor Commented:
thanks DotNetLover but why aren't there any scrollbars when I exceed the vertical size of my textbox?
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You have to set the Scrollbars property either in the IDE or in code like one of these:

    TextBox1.ScrollBars = ScrollBars.None
    TextBox1.ScrollBars = ScrollBars.Vertical
    TextBox1.ScrollBars = ScrollBars.Horizontal
    TextBox1.ScrollBars = ScrollBars.Both

Idle_Mind
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.