Solved

Multiline textbox - add text instead of overwriting it

Posted on 2004-08-10
4
696 Views
Last Modified: 2010-07-27
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.
0
Comment
Question by:jakekula
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 500 total points
ID: 11768814
Hi there...
use
textbox1.text &="something"  (for VB.Net)
textbox1.text +="something";  (for C#.Net)
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11768819
oops... missing "New line part"...  should be

textbox1.text &=VbCrLf & "something"  (for VB.Net)
0
 

Author Comment

by:jakekula
ID: 11768942
thanks DotNetLover but why aren't there any scrollbars when I exceed the vertical size of my textbox?
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 11769007
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now