Solved

Multiline textbox - add text instead of overwriting it

Posted on 2004-08-10
4
695 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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