?
Solved

Multiline textbox - add text instead of overwriting it

Posted on 2004-08-10
4
Medium Priority
?
706 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 2000 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 86

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

807 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